Problem with PHP Session Mgmt on Windows
| From: | David Goldin | Date: | Mon, 15 May 2000 02:29:52 +0000 |
| Subject: | Problem with PHP Session Mgmt on Windows | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-15018@lists.php.net to get a copy of this message | ||
I am running PHP4/Windows 95/Apache and can't seem to get
the session Id functions to work properly.
When I enter the simple program:
<?php
session_start();
session_register('count');
$count++;
echo ("<P>You've been here $count times.</P>");
?>
I keep getting $count = 1 after hitting reload, its not remembering
the session:
See first time it loads:
X-Powered-By: PHP/4.0RC1 Set-Cookie: PHPSESSID=472e1df8949afa78650fc911948aa6e4; expires=Monday, 15-May-00 02:24:10 GMT Expires: Thu, 19
Nov 1981 08:52:00 GMT Cache-Control: no-cache, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html
You've been here 1 times.
When I hit reload (notice it creates a new Session ID, doesn't
remember the last one - its creating a new file each time in
the /tmp folder I specified in my .ini - with the value of
1 for count in each file)
X-Powered-By: PHP/4.0RC1 Set-Cookie: PHPSESSID=461385abb7b22e081ce8c226f8633b7b; expires=Monday, 15-May-00 02:24:38 GMT Expires: Thu,
19 Nov 1981 08:52:00 GMT Cache-Control: no-cache, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html
You've been here 1 times.
When I use session_start() isn't it supposed to remember the session?
Also, how do I get rid of the "X-Powered By: PHP/4........" - do I have some sort of debugging on in my php.ini
Speaking of php.ini, here is my [SESSION] values:
[Session]
session.save_handler = files ; handler used to store/retrieve data
session.save_path = c:/php-4/tmp ; argument passed to save_handler
; in the case of files, this is the
; path where data files are stored
session.use_cookies = 1 ; whether to use cookies
session.name = PHPSESSID
; name of the session
; is used as cookie name
session.auto_start = 1 ; initialize session on request startup
session.cookie_lifetime = 60 ; lifetime in seconds of cookie
; or if 0, until browser is restarted
session.cookie_path = / ; the path the cookie is valid for
session.cookie_domain = ; the domain the cookie is valid for
session.serialize_handler = php ; handler used to serialize data
; php is the standard serializer of PHP
session.gc_probability = 1 ; procentual probability that the
; 'garbage collection' process is started
; on every session initialization
session.gc_maxlifetime = 1440 ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
session.referer_check = ; check HTTP Referer to invalidate
; externally stored URLs containing ids
session.entropy_length = 0 ; how many bytes to read from the file
session.entropy_file = ; specified here to create the session id
; session.entropy_length = 16
; session.entropy_file = /dev/urandom
session.cache_limiter = nocache ; set to {nocache,private,public} to
; determine HTTP caching aspects
session.cache_expire = 180 ; document expires after n minutes
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com