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?
Yes - your webserver doesn’t (and realistically cannot) know if the user
has closed their browser. The cookie which enabled them to get at that
session however has gone away, and so you get a new session, as
expected.
This does mean that session build up over time, most people have some
form of cron jobs that clears out their old sessions.