I can't find any simple examples for using Rack::Session::Cookie
and would like to be able to store information in a cookie, and access it on later requests and have it expire.
These are the only examples I've been able to find:
- How do I set/get session vars in a Rack app?
- http://rack.rubyforge.org/doc/classes/Rack/Session/Cookie.html
Here's what I'm getting:
use Rack::Session::Cookie, :key => 'rack.session',
:domain => 'foo.com',
:path => '/',
:expire_after => 2592000,
:secret => 'change_me'
And then setting/retrieving:
env['rack.session'][:msg]="Hello Rack"
I can't find any other guides or examples for the setup of this. Can someone help?