I'm setting a session to access admin area in my website, I'm checking afterwards for security purposes, the way I check if session has been set is like this:
session_start();
if($_SESSION['LOGIN_CHECK'] == true)
{
}
else
{
header("location:login.php");
}
this works fine in Firefox and Chrome, but when I open a new window from JavaScript (yes the page I open has the session_start() too):
javascript: window.location.href = 'http://www.whatever.com/admin/other/'
It works on Firefox, but in Chrome, the session is deleted...
Any hints?
I don't mean if(isset($_SESSION['LOGIN_CHECK'])){} because when I have started the session I have set LOGIN_CHECK equal to true: $_SESSION['LOGIN_CHECK'] = true; I'm using Javascript in a link to open the new address, and that way the session is still alive when I use firefox. – user997593 May 27 '14 at 20:27