P
Paul
I have this code on my index.php page. It works when cookies are switched
off but gets stuck in a loop when cookies are enabled. I think I know why,
its looping as I have defined the page that the user is already on as the
destination page if cookies are enabled. I thought this would work ok and
not get stuck in a loop. So, is there any way I can get this to work? I want
the user to remain on the index.php page but just be warned that cookies
have been disabled.
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
var tmpcookie = new Date();
chkcookie = (tmpcookie.getTime() + '');
document.cookie = "chkcookie=" + chkcookie + "; path=/";
if (document.cookie.indexOf(chkcookie,0) < 0)
{
alert("Your browser is set to reject cookies, you must enable them to
use this website");
}
else
{
window.location = 'index.php';
}
//-->
</SCRIPT>
off but gets stuck in a loop when cookies are enabled. I think I know why,
its looping as I have defined the page that the user is already on as the
destination page if cookies are enabled. I thought this would work ok and
not get stuck in a loop. So, is there any way I can get this to work? I want
the user to remain on the index.php page but just be warned that cookies
have been disabled.
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
var tmpcookie = new Date();
chkcookie = (tmpcookie.getTime() + '');
document.cookie = "chkcookie=" + chkcookie + "; path=/";
if (document.cookie.indexOf(chkcookie,0) < 0)
{
alert("Your browser is set to reject cookies, you must enable them to
use this website");
}
else
{
window.location = 'index.php';
}
//-->
</SCRIPT>