[Phplib-trackers] [ phplib-Bugs-450638 ] prob with session.inc/get_id()
Brought to you by:
nhruby,
richardarcher
From: <no...@so...> - 2001-08-18 10:00:17
|
Bugs item #450638, was opened at 2001-08-13 15:40 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450638&group_id=31885 Category: None Group: None >Status: Closed >Resolution: Works For Me Priority: 5 Submitted By: Richard Archer (richardarcher) Assigned to: Richard Archer (richardarcher) Summary: prob with session.inc/get_id() Initial Comment: This is Nathan's bug report from the NetUSE bugs forum. -- auto_init appears to always be loaded, whether the session is new or not. Fix: if ( "" == $id ) { $newid=true; $id = $this->that->ac_newid(md5(uniqid($this->magic)), $this->name); } else { $this->in = true; } in the get_id() method of the Session class where it is determined that the session is indeed new. ---------------------------------------------------------------------- >Comment By: Richard Archer (richardarcher) Date: 2001-08-18 01:29 Message: Logged In: YES user_id=279311 This does not appear to be a problem. Unless I inadvertently fixed something in session.inc before testing for this. $sess->freeze registers $sess->in as a persistent variable. page_open() calls $sess->start() which calls $sess->thaw() which will reload $sess->in if it has been registered. $sess->in is set to true in page_open() after calling $sess->start() and just before auto_init is called. page_open() also calls $sess->freeze, so you don't even have to call page_close()! $sess->in should be persistent and should always be true once the session has been initialized. Unless perhaps there was a problem comparing "if (false == "")" in some version of PHP? I'll change the code so $sess->in contains 0 or 1 and is tested as a boolean rather than tested against "". Should make it more robust (or at least more readable) and remain compatible with existing saved sessions. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450638&group_id=31885 |