Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Rails 2.3.2 and lazy sessions issue

#2571

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 :)

Reported by sh · April 27th, 2009 @ 07:06 PM

State: duplicate
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. sh
    sh

    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....?

    April 27th, 2009 @ 09:41 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  3. Michael Lovitt
    Michael Lovitt
    • Importance changed from to

    This should be fixed by #4938.

    June 28th, 2010 @ 11:17 PM

  4. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to duplicate

    June 28th, 2010 @ 11:29 PM