Categorized: Rails, Random

The information in this post is outdated. You might want to look elsewhere for up-to-date information.

Changing the name of an app’s cookie in Rails

While running Tracks and another app on my localhost, I realized that every time I did something on one, it would log me out of the other. Overwriting each other’s cookies!

Add this line to your config/environment.rb:

ActionController::Base.session_options[:session_key] = 'yourappnamehere_session_id'

Then restart the app. All better now.

Source

Comments

Beate → June 17th, 2007 at 4:04 am

I think this is outdated, as in a new project you could find in ApplicationController:

Pick a unique cookie name to distinguish our session data from others’

session :session_key => '_yourappnamehere_session_id'

:)

What do you think about that?

Elsewhere in the empire: Home, Blog, APOD