On 2 Mar 2002 [EMAIL PROTECTED] wrote: > ID: 15822 > Updated by: [EMAIL PROTECTED] > Reported By: [EMAIL PROTECTED] > -Status: Open > +Status: Duplicate > Bug Type: Session related > Operating System: Linux 2.2.19 > PHP Version: 4.1.2 > New Comment: > > It's known problem..... Session become read only. > Thanks for reporting but search reports first :)
They don't become 'read only', on shutdown the wrong array is used to save the data AFAIK. Derick > > > > > Previous Comments: > ------------------------------------------------------------------------ > > [2002-03-01 16:32:53] [EMAIL PROTECTED] > > My web host recently upgraded to PHP 4.1.2. At the same time, my user > login scripts stopped working. A session variable registered with > session_register() is not holding its information when the page > reloads. > > Details: > > I have a file included in every page that looks like: > > > class UserSession > { > var $user_id = 0; > var $username = ""; > var $logged_in = false; > //other stuff elided > } > > session_start(); > global $user_session; > if (!session_is_registered("user_session")) > { > session_register("user_session"); > $user_session = new UserSession(); > } > > function ProcessLogin($Username, $Password) > { > global $user_session; > //username and password are checked against DB contents > //if that's all good, get user row with mysql_fetch_array() > $user_session->user_id = $row[user_id]; > $user_session->username = $row[user_name]; > $user_session->logged_in = true; > //cookies are set and other stuff happens > } > > When a page loads immediately after the user logs in, all is well, and > the values in $user_session are all as I expect them to be. Reloading > the same page, though, causes $user_session to be set back to its > default values. Before the 4.1.2 upgrade, this worked fine. > > I've stripped the code down almost to what I show above, and it still > fails, so I'm pretty sure I'm not doing anything to stomp the values > later in the page. I double-checked that on the page reload, > $user_session is still registered, and it appears to be. > > The changelog at http://www.php.net/ChangeLog-4.php only goes up to > version 4.1.1, so I couldn't tell if there was any change to session > variable handling in 4.1.2. > > Any thoughts? All suggestions are appreciated. > > Config line: > './configure' '--with-mysql' '--with-apache=../apache_1.3.23' > '--enable-track-vars' '--with-xml' '--enable-memory-limit=yes' > '--enable-bcmath' '--with-gd=../gd-2.0.1' '--enable-gd-native-tt' > '--enable-gd-imgstrttf' '--with-gdbm=/usr/include' '--enable-calendar' > '--with-png-dir=/usr/lib' '--with-zlib-dir=/usr/include' > '--with-freetype-dir=/usr/local/include/freetype2' > '--with-jpeg-dir=/usr/local/lib' '--with-mcrypt' '--enable-trans-sid' > '--with-sablot=/usr/local/lib' '--with-imap' '--enable-xslt' > '--with-xslt-sablot' '--enable-sablot-errors-descriptive' > > Host info: > Linux *.*.com 2.2.19-6.2.11 #1 Fri Oct 19 13:28:00 EDT 2001 i686 > unknown > > Server is latest stable Apache. > > ------------------------------------------------------------------------ > > > -- > Edit this bug report at http://bugs.php.net/?id=15822&edit=1 > -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php