Re: [Phplib-users] Re: [Phplib-core] Re: cvs snapshot on sf.net
Brought to you by:
nhruby,
richardarcher
From: Joe S. <jo...@be...> - 2002-09-26 17:12:58
|
On Thu, Sep 26, 2002 at 11:49:56AM +0400, Maxim Derkachev wrote: > > Sorry, I meant page.inc, not prepend.php, which is used to include all > the necessary classes. Page.inc itself just for such conditionals. > > JS> It also moves code that is required for session4.inc to work > JS> correctly in this state out of the class. > Well ... but that would be much more efficient :) > Like I said, I'm open. Just using extract would be fine ( outside any function I guess?) > Variables may be registered in both ways, by using $sess->register() > or by direct assignment to $_SESSION keys. So, we should mind both > ways in is_registered and unregister. I suspect > session_register/session_unregister/session_is_registered know nothing > about $_SESSION array. $_SESSION and $HTTP_SESSION_VARS (the old way) > are different arrays, and not linked to each other. > yes, this seems to be the case. > JS> I ask because Gian's patch basically chose the _SESSION route if globals > JS> off. He and I found that the session_register, session_unregister, and > JS> is_registered all function as before. See his added note to the patch on > JS> sf.net. > JS> The one anomaly he found is on the same iteration that the session > JS> variable is registered, he could use $_SESSION[variablename] to get the > JS> variable contents. I have not been able to get this to work ( It could be > JS> my test). > Okay, got it to work. It was my test. Note however that the contents of $_SESSION[variablename] are not kept up to date if register_globals is off. A simple test in pages/index.php3: printf("<h1>Per Session Data: %s</h1>\n", ++$s); add----> printf("<h1>Per Session Data: %s</h1>\n", $_SESSION['s']); > Yes, I saw the note, but if they changed the behavior once, nothing > prevents them from changing things again, e.g. for performance > reasons. The documented behavior is that those functions don't work > with register_globals=off. > totally agree. > > > >> maybe references to the session variables should be put into $_SESSION > >> in Session::register as well, since $HTTP_SESSION_VARS and $_SESSION > >> are not the same arrays. That would eliminate freeze in Session. I > >> don't like that freeze idea :) > > JS> In practice this hasn't worked for me. I'd like to get rid of that ugly > code in sess->>freeze too. It was just proof-of-concept. > Okay, got this to work too with Gian's session4.inc.new with only one small change. So, corresponding patches, etc will be updated accordingly. Any problem moving the require statement for session4.inc out of session4_custom.inc? thanks, Joe > -- > Best regards, > Maxim Derkachev mailto:max...@bo... > IT manager, > Symbol-Plus Publishing Ltd. > phone: +7 (812) 324-53-53 > www.books.ru, www.symbol.ru > |