My code: File1.php <?php session_start(); $_SESSION['name'] = 'ABC'; ?> File2.php <?php session_start(); if(isset($_SESSION['name']) { echo "Session Set"; } else { echo "Session not Set"; } ?> When I try to run first file "file1.php" and then "file2.php" in Firefox, session value showing correctly at file2.php But then if I try "file2.php" in IE the session value is not showing there. How can I fix this issue. Any help would appreciated. Thanks in Advance.
Why should it be? Sessions are not based strictly on IP addresses but actual session of usage, essentially that would mean someone at a public hotspot could log onto your account from their own machine. Anywho its better that way and most people tend to stick with one browser unless a site presents them a problem. (A method of session management is tracked based on a session ID in a cookie, cookies are not stored cross-browser for security reasons)
That's not entirely true. Sessions in PHP usually have a cookie stored identifying the active session for a browser. The session will not exist from one browser to another, however, another user should not be able to login as you without having that cookie or your session id and IP address. Hope this helps. Shaun Oleson blog.olebox.com