Jump to content

Logout / Kill Session


glennn.php

Recommended Posts

i have this login script but the author provided no logout feature - i'd like to be able to kill the session without the user having to close his browser:

[code]

if (!$errortag){
    session_register("CID");
    $_SESSION["CID"] = $customerid;
    $CID = $customerid;
    $showtable = false;
}

[/code]

can anyone help? have i provided enough info?

I know this is simple - the reason i love these forums is that ya'll can't see me turn red in embarrassment at such times...

thanks,
g

Link to comment
https://forums.phpfreaks.com/topic/9105-logout-kill-session/
Share on other sites

[!--quoteo(post=371447:date=May 4 2006, 11:40 PM:name=glennn.php)--][div class=\'quotetop\']QUOTE(glennn.php @ May 4 2006, 11:40 PM) [snapback]371447[/snapback][/div][div class=\'quotemain\'][!--quotec--]
i have this login script but the author provided no logout feature - i'd like to be able to kill the session without the user having to close his browser:

[code]

if (!$errortag){
    session_register("CID");
    $_SESSION["CID"] = $customerid;
    $CID = $customerid;
    $showtable = false;
}

[/code]

can anyone help? have i provided enough info?

I know this is simple - the reason i love these forums is that ya'll can't see me turn red in embarrassment at such times...

thanks,
g
[/quote]



figured it out, thanks
Link to comment
https://forums.phpfreaks.com/topic/9105-logout-kill-session/#findComment-33487
Share on other sites

[!--quoteo(post=371447:date=May 4 2006, 10:40 PM:name=glennn.php)--][div class=\'quotetop\']QUOTE(glennn.php @ May 4 2006, 10:40 PM) [snapback]371447[/snapback][/div][div class=\'quotemain\'][!--quotec--]
i have this login script but the author provided no logout feature - i'd like to be able to kill the session without the user having to close his browser:

[code]

if (!$errortag){
    session_register("CID");
    $_SESSION["CID"] = $customerid;
    $CID = $customerid;
    $showtable = false;
}

[/code]

can anyone help? have i provided enough info?

I know this is simple - the reason i love these forums is that ya'll can't see me turn red in embarrassment at such times...

thanks,
g
[/quote]


if you want to kill all session varibles you can use

session_destroy();

If you want to kill only one variable you can use
session_unregister("CID");
Link to comment
https://forums.phpfreaks.com/topic/9105-logout-kill-session/#findComment-33488
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.