Skip to content

Instantly share code, notes, and snippets.

@saimonmoore
Created March 3, 2009 14:09
Show Gist options
  • Select an option

  • Save saimonmoore/73328 to your computer and use it in GitHub Desktop.

Select an option

Save saimonmoore/73328 to your computer and use it in GitHub Desktop.
#:key not :session_key in latest edge
#in assets_helper.rb
def new_asset_path_with_session_information
session_key = ActionController::Base.session_options[:key]
new_asset_path(session_key => cookies[session_key], request_forgery_protection_token => form_authenticity_token)
end
#in config/initializers/session_store.rb
ActionController::Base.session = {
:key => '_my_app_session',
:secret => '--blah--' # Real key removed to protect the innocent
}
ActionController::Dispatcher.middleware.use FlashSessionCookieMiddleware, ActionController::Base.session_options[:key]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment