Skip to content

Instantly share code, notes, and snippets.

@elricstorm
Created May 26, 2011 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elricstorm/993390 to your computer and use it in GitHub Desktop.
Save elricstorm/993390 to your computer and use it in GitHub Desktop.
Yourapp::Application.config.session_store :cookie_store
Yourapp::Application.config.session = {
:key => '_yourapp_session', # name of cookie that stores the data
:domain => nil, # you can share between subdomains here: '.subdomain.com'
:expire_after => 1.month, # expire cookie
:secure => false, # for https its true
:httponly => true, # a measure against XSS attacks, prevent client side scripts from accessing the cookie
:secret => 'YOUR SECRET GOES HERE' # RUN RAKE SECRET to generate secret
}
@bruz
Copy link

bruz commented Aug 14, 2011

Thanks for this! For some reason I had a hard time finding these session configuration options elsewhere.

@elricstorm
Copy link
Author

elricstorm commented Aug 14, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment