Re: [PHP] Session file not written, session variables messed up.
Rodolfo wrote: The weirdness comes when in one frame the script will print Agent Smith while in the other frame of the same frameset the script which loads on it will print Thomas Anderson... Are both frames loaded at the same time? It's not possible to have two concurrently running scripts access the same session at the same time (At least when using files as backend). But normally that only means that one script execution is delayed until the other script completes or closes the session manually. But I never used session.auto_start, I always use session_start() in the PHP code. Maybe the auto_start session behaves differently. Maybe you can try disabling auto_start and start the session manually. I don't think it make a difference, but who knows. ;-) On the other hand: Have you checked that your disk has enough room for more sessions? Maybe you are working on the bleeding edge of your harddisk capacity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session file not written, session variables messed up.
Hi Klaus, On Fri, 12 Nov 2004, Klaus Reimer wrote: The weirdness comes when in one frame the script will print Agent Smith while in the other frame of the same frameset the script which loads on it will print Thomas Anderson... Are both frames loaded at the same time? It's not possible to have two concurrently running scripts access the same session at the same time Yes, both are loaded at the same time, I mean, in the same frameset. I don't use trans_sid, and I don't pass the SID constant nor the session_name()=session_id() as a GET to the frame src's referred from the frameset, so I relay on cookies. Both scripts also do a check against a database to see if the session id stored on it is the same as the session id which the login script stored in the $_SESSION array, for that username, so it is supposed that every username logged on the scripts would have one unique session id... always use session_start() in the PHP code. Maybe the auto_start session behaves differently. Maybe you can try disabling auto_start and start the session manually. I don't think it make a difference, but who knows. I should try it anyway, indeed. Also, do you think that with using another session handler (mm perhaps) instead of files the execution could speed up or avoid file problems?. The load of the servers is not that high anyway. I forgot to mention, I'm also using Turck MMCache as cache and optimizer... I don't know if this could cause something weird (wouldn't sound logical, but...). Turck MMCache version is 2.4.6. On the other hand: Have you checked that your disk has enough room for more sessions? Maybe you are working on the bleeding edge of your Yes, I thought it too, but it still has some Gb of free space. I also checked for problems with available file handlers/excesive opened files on the OS side, but everything seems normal. Thank you, Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session file not written, session variables messed up.
Hi, I have a weird problem with sessions on PHP 4.3.9 + Apache 1.3.33 in Slackware, maybe someone could help me or have had the same problem. I'm getting these messages in my logs: PHP Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/tmp/php) in Unknown on line 0 /var/tmp/php is owned by the user/group Apache is running as, and it has 0700 permissions. This message appears sporadically. I googled but I only got answers related to permissions. This happens with an application which consists in two frames loading distinct scripts. I print the content of one session variable in both frames, let's say: ?php // do many stuff... then: echo $_SESSION['fullname']; ? The weirdness comes when in one frame the script will print Agent Smith while in the other frame of the same frameset the script which loads on it will print Thomas Anderson... and the actual full name in the database is Trinity (both Agent Smith and Thomas Anderson are also in the database, related to different logins each one). The session variables get their values from a database, in one point of the login script only, by simple assignment: // query the database to get the full name for $_POST['login'], where // login is unique... then: $_SESSION['fullname'] = $rs['fullname']; I have not been able to determine if the warning message is related to this weird behavior. This behavior shows up sporadically. I'm using this session config in php.ini: session.save_handler = files session.save_path = /var/tmp/php session.use_cookies = 1 session.use_only_cookies = 1 session.name = SID session.auto_start = 1 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 1000 session.gc_maxlifetime = 7200 session.bug_compat_42 = 1 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 16 session.entropy_file = /dev/urandom session.cache_expire = 180 session.use_trans_sid = 0 url_rewriter.tags = a=href,area=href,frame=src,input=src,form=fakeentry The client browser has been MSIE 6.0 in all cases. Any help is appreciated. Thanks in advance. Rodolfo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php