Welcome Guest, Not a member yet? Register   Sign In

[eluser]Wonder Woman[/eluser]

Is there anyway to destroy the ci_session cookie when the browser is closed?

Thanks in advance.

[eluser]Brad K Morse[/eluser]
You could have users go to a designated URL first, which will destroy the session, then create a new session, making note of them going to that page first, then redirecting them to the appropriate page.

If they go directly to the other page first, check their session for that flag, then if it is not found, redirect them to the first page that destroys the session.

its a hackish way, but it might work in your case.

Basically what you are looking for is this:
Destroy session on window close

Because it's not a "real" session and has Cookies involved, it has some javascript hacks and such that make it possible. By default it's not too straightforward though.

I have either used normal PHP sessions, used a "real" PHP Session CodeIgniter Library or just done quick timeouts whenever inactivity arises.

can you try

$config['sess_expire_on_close'] = TRUE;

in your config.php

Theme © iAndrew 2016 - Forum software by © MyBB