PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi all,
I'm running apache 2 and PHP 4.3.4 under WinXP;
My problem is that php opens a new session when i'm going from a page to another.
So the very simple code below doesn't work, the session variables cannot be retreived because the session change... The same code works on a Linux OS.
Do someone knows that problem? please help!
Thx. Jim
The directory exist and contains the files sess_*
The problem is that it creates a "session file" for each page visited. So when click on a link a new sess file is created. That why I cannot find variable back... Am I clear?
; This option enables administrators to make their users invulnerable to
; attacks which involve passing session ids in URLs; defaults to 0.
; session.use_only_cookies = 1
; Name of the session (used as cookie name).
session.name = PHPSESSID
; Initialize session on request startup.
session.auto_start = 0
; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0
; The path for which the cookie is valid.
session.cookie_path = E:/Program Files/Peaktime/xmlratserver/Apache Server/Apache/www/cookies
; The domain for which the cookie is valid.
session.cookie_domain =
; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php
; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
session.referer_check =
; How many bytes to read from the file.
session.entropy_length = 0
; Specified here to create the session id.
session.entropy_file =
;session.entropy_length = 16
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
; Document expires after n minutes.
session.cache_expire = 180
Paths with spaces are require to be enclosed in quotes so as suggested enclose the value of seesion.save_path in quotes.
This is also the case for session.cookie_path, however you should note that the value of session.cookie_path is not a path to save files to. This value represents allowable directories for which the cookie will be accessable. So with your current config only scripts which are in the directory "E:/Program Files/Peaktime/xmlratserver/Apache Server/Apache/www/cookies" and any subsequent sub directories will be able to access the session cookie.
My code still doesn't work, I "double-quoted" the path, I even tried to put session files in "E:\temp" but no result either. The session file are still created at each page visited...
I had some problems with Apache2 running as a service on win2k, I created an apache user with appropriate permissions and set that user as the logon for the Apache service. Don't think it would make any difference in your case but may be worth a shot.