Welcome Guest, Not a member yet? Register   Sign In
Session doesn't end when browser window is closed
#2

(This post was last modified: 04-05-2016, 03:21 PM by dmyers.)

A session cookie is dropped by the browser based on how you set it's expires / max-age value.
In CodeIgniter this is set using $config['sess_expiration'] in the config.php file.

From the config.php file.
| 'sess_expiration'
|
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.

Therefore unless you manually "dump" the session it will be valid until the expiration at which time the browser will delete the cookie.

Since HTTP is stateless you actually have no idea if a user has "left" your web site (unless your doing some kind of ajax hacks or something).

https://en.wikipedia.org/wiki/Stateless_protocol

Don Myers
Reply


Messages In This Thread
RE: Session doesn't end when browser window is closed - by dmyers - 04-05-2016, 01:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB