How do I set a Rails cookie to start and/or expire at a certain date?
your question might be related to this question: How to I dynamically set the expiry time for a cookie-based session in Rails
one of the comments points to Deprecating SlideSessions:
"..If you need to set expiration period for sessions through all controllers in your application, simply add the following option to your config/intializers/session_store.rb file:
:expire_after => 60.minutes
If you need to set different expiration time in different controllers or actions, use the following code in action or some before_filter:
request.session_options = request.session_options.dup request.session_options[:expire_after]= 5.minutes request.session_options.freeze
Duplication of the hash is needed only because it is already frozen at that point, even though modification of at least :expire_after is possible and works flawlessly..."
I hope that helps. :)