Session updates ok first time only.

From: Date: Sun, 27 Jan 2002 20:37:34 +0000
Subject: Session updates ok first time only.
Groups: php.general 
Request: Send a blank email to php-general+get-82316@lists.php.net to get a copy of this message
Can someone tell me why this is not working right? Two pages are basically the same, passing an accumulating value back and forth. There is no other session being created. The first time it increments and passes to the second page, and is picked up. It puts a 1 in the session file. After that, it seems to try, as in editor wanting to reload, but the contents don't increase beyond 1. I have 4.1, register globals off, on Windows 98. TIA session_start(); print "<html>"; print "<body>"; // determine session id $session = $_REQUEST['session']; if ($session == ''){ $session = session_id();} print "SESSION = $session"; // create a registered variable. session_register('page_views'); //pull value from session file: $page_views = $_SESSION['page_views']; print "<br>Send Page"; print "<br>Before increment = $page_views"; $page_views++; print "<br>After increment = $page_views"; // go to next page with session id: print "<FORM ACTION='sess_return.php3' METHOD='post'>"; print "<INPUT TYPE=hidden NAME='session' VALUE=$session>"; print "<INPUT TYPE=submit VALUE=Submit> < or > <INPUT TYPE=reset VALUE=Clear></form>"; ?> </body> </html> session_start(); print "<html>"; print "<head>"; print "</head>"; print "<body>"; //determine a session id: $session = $_REQUEST['session']; if ($session == ''){ $session = session_id(); } print "SESSION = $session"; // create a registered variable. // alredy done. //session_register('page_views'); //pull a value from the session file: $page_views = $_SESSION['page_views']; print "<br>Return Page"; print "<br>Before increment = $page_views"; //increment the counter: $page_views++; $page_views++; print "<br>After increment = $page_views"; //going to next page with session id: print "<FORM ACTION='sess_send.php3' METHOD='post'>"; print "<INPUT TYPE=hidden NAME='session' VALUE=$session>"; print "<INPUT TYPE=submit VALUE=Submit> < or > <INPUT TYPE=reset VALUE=Clear></form>"; ?> </body> </html> php.ini [Session] session.save_handler = files session.save_path = c:/tmp session.use_cookies = session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_maxlifetime = 1440 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 1 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" --

« previous php.general (#82316) next »