undocumented process in session handling...

From: Date: Fri, 23 May 2003 18:33:36 +0000
Subject: undocumented process in session handling...
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969353825@lists.php.net to get a copy of this message
I just spent the better part of two days trying to track down a solution to what I thought was a bug. I reported Bug #23764 and went indepth into discussion of my example scripts which showed the odd behavior. As sniper@php.net so un-eloquently pointed out to me, the problem was that I wasn't doing one particular thing. However, I scoured the online documentation about sessions, trying to find an explanation to how to do this, and though I never found anything specific, I did find hints of what to do. Obviously, however, I was not doing it correctly, cause when I employed his "suggestion", it worked flawlessly. Specifically, my question was how to have window "A" load a script which started a session, and in that window, a link which launched a new window "B" (like a popup) with another script in it, and have the script in window "B" declare that it wanted to use it's own session instead of just starting (inheriting) the session passed to it by default from window "A". Two functions are discussed in the documentation, session_name() and session_id(). For the script in window "B" I tried first to employ changing the name of the session, and this did not seperate the "link" making the two windows share the same session. Then, I switched to changing the session_id(), again with no luck. Just now, I tried changing both the session_name and the session_id in window "B", and it worked. I think there are certainly other people who are not session experts in PHP and would benefit from knowing the simple fact that to cause a script to discard any previous sessions it is inheriting and start its own new one, you have to change both pieces of information. And, apparently, you have to change at least the _name() before every subsequent call to session_start() in window B's scripts, or it will revert back to the window A's session. In my opinion, the fact that the two are paired like this is enough of a non-intuitive quirk to cause a sufficient stumbling block for others like me. I would request some wording be added to the session documentation and/or to each of the 3 specifically affected session functions (session_id(), session_name(), session_start()). Thank you for your time. Kyle Simpson Web Developer/Programmer Ambion, Inc. (512) 651-0200, xt6176 http://www.ambion.com "In theory, theory and practice are the same, but in practice, they're not..." +++++++++++++++++++CONFIDENTIALITY NOTICE+++++++++++++++++++ This message is confidential and intended for the addressee only. If this reaches you in error, please reply to the sender and delete immediately.

« previous php.doc (#969353825) next »