brsy nah mang May 12, 2011 1,530 272 Feb 25, 2012 #1 PHP: <?php session_start(); session_destroy(); if(session_destroy()) { header("Location: http://pabbo.net/index.php"); } ?> Would the if statement be valid?
PHP: <?php session_start(); session_destroy(); if(session_destroy()) { header("Location: http://pabbo.net/index.php"); } ?> Would the if statement be valid?
Markshall Русский Стандарт Contributor Dec 18, 2010 2,637 2,389 Feb 25, 2012 #2 You don't really need the if statement. Just do PHP: <?php session_start(); session_destroy(); header( "Location: http://pabbo.net/index.php"); ?> Upvote 0 Downvote
You don't really need the if statement. Just do PHP: <?php session_start(); session_destroy(); header( "Location: http://pabbo.net/index.php"); ?>
brsy nah mang May 12, 2011 1,530 272 Feb 25, 2012 Thread starter #3 m0nsta. said: You don't really need the if statement. Just do PHP: <?php session_start(); session_destroy(); header( "Location: http://pabbo.net/index.php"); ?> Click to expand... Okay thanks, but the if statement would still work, right? Upvote 0 Downvote
m0nsta. said: You don't really need the if statement. Just do PHP: <?php session_start(); session_destroy(); header( "Location: http://pabbo.net/index.php"); ?> Click to expand... Okay thanks, but the if statement would still work, right?
Markshall Русский Стандарт Contributor Dec 18, 2010 2,637 2,389 Feb 25, 2012 #4 Twizt said: Okay thanks, but the if statement would still work, right? Click to expand... Yeah it would work no doubt, but it's not necessary - it would be pointless code really. Upvote 0 Downvote
Twizt said: Okay thanks, but the if statement would still work, right? Click to expand... Yeah it would work no doubt, but it's not necessary - it would be pointless code really.
RastaLulz fight teh power Staff member May 3, 2010 3,926 3,923 Feb 25, 2012 #5 Wouldn't it be better to unset a particular session, instead of all sessions? You must be registered for see links Upvote 0 Downvote
Wouldn't it be better to unset a particular session, instead of all sessions? You must be registered for see links
brsy nah mang May 12, 2011 1,530 272 Feb 25, 2012 Thread starter #6 RastaLulz said: Wouldn't it be better to unset a particular session, instead of all sessions? You must be registered for see links Click to expand... Why, when the user will be completely logged out? How would that be useful? Upvote 0 Downvote
RastaLulz said: Wouldn't it be better to unset a particular session, instead of all sessions? You must be registered for see links Click to expand... Why, when the user will be completely logged out? How would that be useful?
RastaLulz fight teh power Staff member May 3, 2010 3,926 3,923 Feb 25, 2012 #7 Twizt said: Why, when the user will be completely logged out? How would that be useful? Click to expand... Because it's bad practice to unset ALL sessions, where as all you SHOULD be doing is unsetting the user related session. Upvote 0 Downvote
Twizt said: Why, when the user will be completely logged out? How would that be useful? Click to expand... Because it's bad practice to unset ALL sessions, where as all you SHOULD be doing is unsetting the user related session.
Markshall Русский Стандарт Contributor Dec 18, 2010 2,637 2,389 Feb 25, 2012 #8 Actually he's right, you may have other sessions set and don't want to destroy them. Using session_destroy will destroy all sessions you have on that web-server., where as using unset() you can just destroy specific sessions. Upvote 0 Downvote
Actually he's right, you may have other sessions set and don't want to destroy them. Using session_destroy will destroy all sessions you have on that web-server., where as using unset() you can just destroy specific sessions.