Gandalf StormCrow
Gandalf StormCrow

Reputation: 26202

Using redis as a session store

I'm using redis as a session store and for some other stuff too. I use gem redis-rails and this is how I configured it for heroku :

MyApp::Application.config.session_store :redis_store , redis_server: ENV['REDISTOGO_URL']

How and where do I set default ttl for all redis keys? Is this even possible?

Upvotes: 1

Views: 1002

Answers (1)

rhernando
rhernando

Reputation: 1071

You have to set the parameter expire_in

MyApp::Application.config.session_store :redis_store , redis_server: ENV['REDISTOGO_URL'], :expire_in => 900

Units are in seconds

Upvotes: 1

Related Questions