Safari and Cookies -
09-25-2003
, 01:24 AM
I have been using the following code to test whether cookies are enabled in the
user's browser. But, it doesn't work in the Safari browser. My code always
assume that cookies are disabled in Safari (regardless of whether that is true
or not). What do I need to do differently?
// ***** Test for cookies being enabled in user's browser. ***** //
var expDate = new Date("December 1, 2000");
var preciseExpDate = expDate.toGMTString();
document.cookie = "estimate=test";
if ( !document.cookie )
{
// Perform this code if cookies are disabled.
}
else
{
// Perform this code if cookies are enabled.
}
Thanks,
Jim |