[PHP] session_destroy
Hello Everyone, Can someone please give me example code on how to use session_destroy because I can not get it to work. Also if you have an example for gc_probability I would love that too. Thank You :) Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] session_destroy()
Just curious if anyone knows how to properly destroy a session. I tried doing this, session_start(); session_unregister("logged_in"); session_unregister("username"); session_unregister("password"); session_unregister("accesslevel"); session_unregister("emailaddress"); session_unregister("last_login"); session_destroy(); However that doesn't work, the session isn't terminated and the session variables are still available. Help anyone? :-)
[PHP] Session_destroy problems...
Hi all, I am a log time lurker on this list thanks to all the major contributors who have helped me learn :-) I seem to have a problem with teh session_destroy function in that it appears not to work for me I am running RH7.1 (kernel 2.4.10) with php4.0.5 . here is the code that is not working.. if ($PHPSESSID) { session_start(); session_destroy(); } unset($PHPSESSID); ... could anyone tell me why this does not get rid of the session marker on the browser as my "logout" function is failing and the above is all that is in the script !... thanks in advance richard __ Do You Yahoo!? Find a job, post your resume. http://careers.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] session_destroy() fails...
I am looking into sessions at the moment and havn´t got it all working properly to continue my journey. I´m having problem with the session_destroy(), and after some searching in the archive, I found out that other people have had this problem aswell, but I didn´t find a fix... Here is the error message I get: Warning: Session object destruction failed in E:\Inetpub\wwwroot\testscript\sessions\test.php on line 5 Here is my code: Is this error caused by php.ini, my webserver or other? My configuration: IIS 5 for Win2k PHP 4.0.3 PL 1 Thanks // Tobbe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
SV: [PHP] session_destroy
I always call unset before destroy. Worked fine when I had problems with destroy. /Håkan Brandon Orther <[EMAIL PROTECTED]> skrev i diskussionsgruppsmeddelandet:CKEMJEADMOCEHPHJKLPAGEGLCDAA.brandon@webintelle cts.com... > Hello Everyone, > > Can someone please give me example code on how to use session_destroy > because I can not get it to work. Also if you have an example for > gc_probability I would love that too. Thank You :) > > Thank you, > > > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] session_destroy()
> -Original Message- > From: Nick Adams [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 01, 2001 3:47 PM > To: [EMAIL PROTECTED] > Subject: [PHP] session_destroy() > > > Just curious if anyone knows how to properly destroy a session. As I understand it, session_unregister() removes a variable from the list of session variables. session_destroy removes the session's content from wherever it is being stored (e.g., a file in /tmp). To delete the *values* of the variables immediately, use session_unset(). Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] session_destroy()
"Nick Adams" <[EMAIL PROTECTED]> wrote: > 1. (*) text/plain > > Just curious if anyone knows how to properly destroy a session. > I tried doing this, > > session_start(); > > session_unregister("logged_in"); > session_unregister("username"); > session_unregister("password"); > session_unregister("accesslevel"); > session_unregister("emailaddress"); > session_unregister("last_login"); > > session_destroy(); hmm i guess session_destroy() should unregister all variables too, try echo session_destroy() to see if it returns 1. -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] session_destroy() fails...
At 01:25 02.03.2001, Tobias Talltorp said: [snip] >session_start(); >session_register("value"); >session_unregister("value"); >session_destroy(); >?> [snip] Why would you want to create and destroy the session data during a single request? That simply doesn't make sense - session persistence is designed to keep registered session data available across _a_series_ requests. I believe PHP chokes at session_destroy() since the session save file has not yet been created, and thus deleting the session data returns an error code. Try this - it should work: "; echo "input type=submit>"; session_start(); session_register($value); } ?> ...ebird >O Ernest E. Vogelsinger (\)http://www.1-at-web.at/ ^ ICQ# 13394035 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] session_destroy() fails...
> Why would you want to create and destroy the session data during a single > request? That simply doesn't make sense - session persistence is designed > to keep registered session data available across _a_series_ requests. This I know, but it was just to show what I wanted to do. > I believe PHP chokes at session_destroy() since the session save file has > not yet been created, and thus deleting the session data returns an error code. I first got the problem when I tried this tutorial at Zend: http://www.zend.com/zend/tut/session.php I found it funny that a tutorial about sessions had such a "bug", since it was supposed to cover this feature. Complete source can be downloaded here: http://www.phpwizard.net/resources/tutorials/session_intro.html I had to change some in your code (lines marked with >>)... > if (isset($value)) { echo "thanks"; session_destroy(); } else { // These were below the echo before... >> session_start(); >> session_register($value); $value = 12; echo ""; echo "input type=submit>"; } ?> Error message: Warning: Trying to destroy uninitialized session in E:\Inetpub\wwwroot\testscript\sessions\test.php on line 4 Just a thought... Could it have anything with the session.save_path? session.save_path =e:\Temp\sessions Regards, // Tobias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] session_destroy won't work, PHP 4.0.3pl Win95
I am able to create a session. A cookie is set in the browser. The variables I registered are in the session. I can access it. But I can't do anything that would modify or destroy the session. Example: If I have a script: PHP gives me this error: "Warning: Session object destruction failed in script.php on line (session_destroy line #)" and I get my "Couldn't destroy" message. And, in fact, the session file remains in my c:\temp folder, and next time a script is called and does session_start(), it gets all the original values of my session. Similarly, in a different script, no matter what I do about changing my registered variables, next time a script is called with session_start(), the original values are still in the session. I cannot do anything about changing the contents of a session at all. (And the cookie is still set, but I know about how that works. But I want to destroy the session on the server, which is what I thought session_destroy was supposed to do.) Any ideas? - Ken [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php