This project is archived and is in readonly mode.
Rails 2.3.2 and lazy sessions issue
Reported by sh | April 27th, 2009 @ 07:06 PM | in 3.x
fresh rails 2.3.2 app configured with db session store
controller code:
@foo = nil
if session.nil?
@foo = "foo"
else
@foo = session[:foo]
end
This creates an entry in the sessions table. This seems counter-intuitive and I'd expect to have a session created only when data is added to the session. Checking for sessions should not cause new sessions to be created.
And, I'd really love to have "sessions :off" per controller back :)
Comments and changes to this ticket
-
sh April 27th, 2009 @ 09:41 PM
ignore the above. the only code that is relevant is this:
environment.rb:
config.action_controller.session = { :key => '_sessions_test', :secret => 'whatever' } config.action_controller.session_store = :active_record_store
controller:
def index logger.debug session.size end
every request creates an entry in the sessions table....?
-
Michael Lovitt June 28th, 2010 @ 11:17 PM
- Importance changed from to
This should be fixed by #4938.
-
Jeremy Kemper June 28th, 2010 @ 11:29 PM
- State changed from new to duplicate
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 4938 [PATCH] Session fixes: sessions should not be created until written to; and session data should be destroyed on session reset https://rails.lighthouseapp.com/projects/8994/tickets/25...