Looking for Basic Example of Rack Usage
New to Ruby. And I feel like this is going to be a particularly noob
question. And I'm a bit at a loss, I can't find any simple examples for
using Rack::Session::Cookie. I'd 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
So 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"
But I can't find any other guides or examples for the setup of this.. Any
help here?
No comments:
Post a Comment