PDA

View Full Version : Cookies


morpheause
12-17-2003, 09:41 AM
Hi Guys,

Is there a script that can check if cookies are blocked on a machine, and if the cookie is block that it redirects the surfer to help page explaining them how to enable it.

For Example
Block all cookies on your browser, close your browser down and restart it, then go to http://www.discoveryworld.co.za/

Thanking you in advance.

Willy Duitt
12-17-2003, 01:45 PM
Try this:

<script type="text/javascript">
document.cookie = 'HasCookie';
function chkCookie() {
var dc = document.cookie;
if(!dc.match('HasCookie')) {
alert('You will require cookies enabled to use this site.');
window.location.replace('http://YOUR_NO_COOKIE_REDIRECT_PAGE.html');
}
else {
location.href = location.href;
}
}
window.setInterval("chkCookie()", 2000);
</script>

.....Willy