views:

120

answers:

4
A: 

Sessions will break if the user visits a sub-path of your site root and then navigates upwards. This is because the cookie will only be set for that path, not your entire domain. More info here: http://www.php.net/manual/en/function.session-start.php#91298

no
I redirect from https : //domain.com/login to https : //domain.com/profile , both links are rewritten to https : //domain.com/index.php by mod_rewrite.
ubes
It sounds like this isn't your problem then. Still, it doesn't hurt to double-check the stored cookie paths make sure they are all set to root.
no
Checked. Both set to root. Remember I have the same PHP code running smoothly on another apache so I'm not expecting this to be a problem with my code. Prolly a windows, apache or php settings issue.
ubes
Probably so... you could try comparing the output from `print_r($_SERVER)` and `phpinfo()` and see if there are any obvious differences between the two servers...
no
Both are identical
ubes
Just shooting in the dark at this point but does the server run at the console work if you run it by itself without the NT service running? Maybe the configurations are *too* identical, like they are using the same httpd.conf or port or something? Alternatively, why not try installing both servers as NT services?
no
A: 

Can you try storing and accessing sessions from DB ?

Osman Üngür
I'm not sure what you mean by that..
ubes
A: 

Look at the permissions of the php session directory where the files for the session are being stored. If php doesn't have the rights to write, create and change files you won't be able to store anything in your $_SESSION var.

ITroubs
A: 

I found the solution. The user that runs the webserver did have permission to all paths in the httpd.conf but did not have permission to access all paths in PHP.ini. session.save_path is one of those paths and the server can't access session data if it can't store session data.

The session.save_path was set to C:\Windows\Temp and initially I did not think I had to give permissions to anything but the apache dirs, php dirs and webroot.

Thanks for all your help!

ubes