...

View Full Version : checking cookie support



bafl
10-13-2003, 09:53 PM
I want to check cookie support on the clients browser. If he doesnt support cookies a popup message should popup. I use the following script but somewhere it is going wrong. Please help me!??
--------------------------------------
<script type="text/javascript">
var cookieEnabled=(navigator.cookieEnabled)? true : false

//if not IE4+ nor NS6+
if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){
document.cookie="testcookie"
cookieEnabled=(document.cookie=="testcookie")? true : false
document.cookie="" //erase dummy value
}

//if cookies are enabled on client's browser
if (cookieEnabled) {
alert("you have to enable your cookies ...");
echo(cookieEnabled);
}
</script>
-----------------------------------------------
bst wshs Bafl



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum