Re: question about note on php.net
| From: | brian | Date: | Sun, 12 Aug 2007 00:46:20 +0000 |
| Subject: | Re: question about note on php.net | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260715@lists.php.net to get a copy of this message | ||
Michael Cooper wrote:
Hello, I have a question--is the note from equazcion here correct? It is left unchallenged on the page but I can't see how it is correct since I am under the impression that the environment is refreshed each page load and the function or method definitions (including those for session_set_save_handler) would need to be re-established each page, not each session. I am having tremendous difficulty debugging some code I wrote and eliminating my uncertainty regarding this point would be greatly helpful. Any advice would be appreciated. Thanks!Because i'm already procrastinating ... google "site:php.net equazcion" http://www.php.net/session_set_save_handler wherein:
equazcion 10-Mar-2007 02:44 I know this might be obvious, but session_set_save_handler() should only be called once per session, or else your saved data will keep getting reset. If your script doesn't have a predictable start page that will only be called only once per session, place the session_set_save_handler statement in an include file, and call it via require_once().I doubt that this is correct. The save handler that is being set is not, in itself, a part of the session, but a function that is to be used to act upon the session. That is, there isn't anything inherent to the session in the function. Thus, it wouldn't be saved as *a part of* the session. It's just a handler. It's not as if the function, itself, were a container for the session vars. My $.02