This is a discussion on Logging Users Out within the PHP General forums, part of the PHP Programming Forums category; So I am using the following code to log people in. $uid = $rowlogin["UserID_PK"]; session_register("uid"); ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
So I am using the following code to log people in.
$uid = $rowlogin["UserID_PK"]; session_register("uid"); where $rowlogin is a query on a database of users. my code for logging someone out looks like this. session_unregister("uid"); unset($uid); the problem is that I have this link that links to login.php when the session isn't registered and logout.php when the session is registered. This link doesn't update correctly. After I logout, the link for logout still appears. I have to manually refresh the browser (press F5) to have the login link appear instead. The same happens after I log in. Does anyone know what might be going on? Here's how I check for user login. method 1 if(isset($uid)) { echo " logout link html"; } else { echo " login link html"; } method 2 if(session_is_registered("uid")) { echo " logout link html"; } else { echo " login link html"; } both methods give me the same problem. I have to actually refresh the page before the links are changed. I know for certain that the $uid variable and the session has been properly changed. But it seems that the browser isn't telling the php server to refresh the page, and loading up a cached page instead. Any ideas? ##-----------------------------------------------## Article posted from PHP Freaks NewsGroups http://www.phpfreaks.com/newsgroups Get Addicted: php.general ##-----------------------------------------------## |