Quote:
Originally Posted by Bellardia
I may have spoken too quickly on that last comment. I was under the impression that you could clear sessions since they are (at least partly) sever sided, however I'm not sure exactly where they are saved or how to clear them.
Better suggestion - use a php script that writes a session such as $_SESSION['flush'] = 1; to mark the user has already seen the script, if they haven't viewed the script yet redirect them to the logout page.
Code:
<?
session_start();
if ($_SESSION['flush'] != 1)
{
$_SESSION['flush']= 1;
header( 'Location: /login.php?do=loguserout&u='.$bbuserinfo[userid] ) ;
}
?>
Try imbedding this in the php of your index file, make sure it executes before any output since it uses a header.
|
Interesting, I will have to play around with that one. Thanks man
Quote:
Originally Posted by Dismounted
PHP Code:
$logout_time = $vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'nextlogout', TYPE_UINT);
if (TIMENOW > $logout_time) { // clear authentication cookies vbsetcookie('sessionhash', ''); vbsetcookie('userid', ''); vbsetcookie('password', '');
// set next clear time vbsetcookie('nextlogout', TIMENOW + 604800); }
|
Ohh nice, I tried this one and it seems to work exactly like the one I posted.. Any idea what the pros and cons to using this one over the one I posted?