Jump to content

session_destroy help


shadiadiph

Recommended Posts

on my site the user can login and the session is registered on the checkuser page and diverts to the index page.

 

code in checkuser

session_register("username");
session_register("password"); 
$updatesql ="update tblclientdetails set dtlogged = now() where username='$username'";
$DB_site->query($updatesql);
header("location:index.php");

 

 

index.php

if(!session_is_registered("username")){
header("location:login.php");
}

 

problem I have is if the user just goes from the index page to say yahoo.com and then back to the index page they are still logged in the session is still active it is only not active if they open a new browser window and try or click logout. How do I make it so when they navifgate away from my site the session gets destroyed??

 

Link to comment
https://forums.phpfreaks.com/topic/147508-session_destroy-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.