should rails sessions remain after the browser has closed???

Hi,

Just double checking - should rails sessions remain after the browser has closed???

I’m running active record sessions (i.e. persisted to database via active record), however I note that closing the browser and re-opening builds up multiple sessions in the database table. Is this expected behavior for a session?

Tks

Greg,

This is normal behavior. You need to cleanup these sessions yourself which can easily be done with rake during development (rake db:sessions:clear) or a cron job in production (http://depixelate.com/2006/11/10/quick-tip-flexible-session-sweeping).

Hope this helps.