Reputation: 22605
I have the following source code
session1.php
<?php
session_start();
echo session_id();
?>
session2.php
<?php
session_start();
echo session_id();
?>
when I access session1.php then access session2.php, I get a different ouput.
Why is this doing it?
Upvotes: 2
Views: 4247
Reputation: 9308
If you're running under *nix, try setting session.save_path
to /tmp
. If that doesn't work, look in your browser's cookie cache to see if the cookie is indeed being saved by the browser.
Upvotes: 0
Reputation: 7464
A rare edge case, but I found that having a dot in the session name of php.ini
caused this problem!!
session.name = THIS.DOESNTWORK
Upvotes: 0
Reputation: 1
Try storing your session cookies in the database rather than on the server. This saved me heaps of time out and other session cookie problems especially if you are on a shared server.
This might help: http://www.raditha.com/php/session.php.
Good Luck
Upvotes: 0
Reputation: 31685
The browser is not sending the session cookie back to the server. This can have two reasons.
Upvotes: 3