Hi,
I would like to use the standard PHP sessions and I understand they rely on
the target web browser to support session cookies.
I have tried the following code:
<?
session_start() ;
if (!session_id()) { //no support for session
header("Locatio n: nocookie.php");
exit();
} else { //session open
....
}
}
echo "cookie ok, user logged as ".$_SESSION['uid'];
?>
I wanted to reroute the user to a "nocookie" page (advice page) if their web
browser does not support cookies, but it does not seem to work, even if I
put IE in the hightest privacy settings.
I know PHP can also use the URL to maintain sessions, but this does not work
very well in my experience.
Any ideas on how to detect no support of session cookies, on one single
page?
Thanks,
Tom
I would like to use the standard PHP sessions and I understand they rely on
the target web browser to support session cookies.
I have tried the following code:
<?
session_start() ;
if (!session_id()) { //no support for session
header("Locatio n: nocookie.php");
exit();
} else { //session open
....
}
}
echo "cookie ok, user logged as ".$_SESSION['uid'];
?>
I wanted to reroute the user to a "nocookie" page (advice page) if their web
browser does not support cookies, but it does not seem to work, even if I
put IE in the hightest privacy settings.
I know PHP can also use the URL to maintain sessions, but this does not work
very well in my experience.
Any ideas on how to detect no support of session cookies, on one single
page?
Thanks,
Tom
Comment