Ask a Question related to PHP Notes, Design and Development.
-
staypuffinpc@hotmail.com #1
note 33554 added to function.session-destroy
A little more on destroying the session cookie:
I've tried everything everyone here has suggested as far as destroying cookies go and none of them has worked for me. That is, I can destroy all session variables, but since the cookie stays on the user's computer, I can still get to pages I should only be able to get to after logging in even if I've logged out. My solution is more of a work-around than a solution. When unsetting the cookie and session variables, I changed the cookie to ""(nothing) by typing:
setcookie('myCookie',"", time()+60*60*24*120);
then, in my authentication function, I added this:
if (!session_is_registered("myCookie") or ($myCookie==""))
I know this doesn't actually get rid of the cookie, but since it destroys all the information, it does the same thing. (in case you're wondering why I didn't change the expiry, it's just because I didn't need to in order for this to work, but you should probably change the expiry as well) Hope this helps!
----
Manual Page -- [url]http://www.php.net/manual/en/function.session-destroy.php[/url]
Edit Note -- [url]http://master.php.net/manage/user-notes.php?action=edit+33554[/url]
Delete Note -- [url]http://master.php.net/manage/user-notes.php?action=delete+33554&report=yes[/url]
Reject Note -- [url]http://master.php.net/manage/user-notes.php?action=reject+33554&report=yes[/url]
staypuffinpc@hotmail.com Guest
-
note 33912 added to function.session-start
I WILL RULE THE WORLD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!... -
note 33852 added to function.session-unset
True, i agree!True, i agree!True, i agree!True, i agree!True, i agree!True, i agree!True, i agree!True, i agree!True, i agree!True, i agree!True, i... -
note 33765 added to function.session-set-save-handler
in reply to myself... (05-Jun-2003 09:09) well. you DO get the whole session info on _read() if you do actually _write the info.. and dont... -
note 33714 added to function.register-tick-function
please can anyone help me to discover if this function can be used to make a chat ---- Manual Page --... -
note 33575 added to function.register-shutdown-function
If your script exceeds the maximum execution time, and terminates thusly: Fatal error: Maximum execution time of 20 seconds exceeded in - on line...



Reply With Quote

