session handler

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pixelwraith
Forum Newbie
Posts: 18
Joined: Wed Apr 14, 2004 11:01 am

session handler

Post by pixelwraith »

im posting this again because i thought it might get lost at the bottom of my old post - hope its ok :)


ive tried the code in tek-tips
http://www.tek-tips.com/gfaqs.cfm/pid/434/fid/2037
for session handling
it allows me to log in but doesnt delete the session variables so i can never log out

my logout code definately works as ive used it with another session handler and file based sessions but here it is anyway
<?
$go = "../adminlogin.php";
header("Location: $go");
include("../../include/session_mysql.php");
session_start();
unset($_SESSION['details']);
unset($_SESSION['valid_user']);
unset($_SESSION['timeout']);
session_destroy();
?>

has anyone been able to use this code (tek-tips) successfully?
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

Post by mudkicker »

use session_unset() ??
pixelwraith
Forum Newbie
Posts: 18
Joined: Wed Apr 14, 2004 11:01 am

Post by pixelwraith »

here it says
Note: If $_SESSION (or $HTTP_SESSION_VARS for PHP 4.0.6 or less) is used, use unset() to unregister a session variable, i.e. unset ($_SESSION['varname']);.

as i have used $_session
i tried it anyway just in case and it didnt work
i dont think its the logout code
Post Reply