HighDots Forums  

Safari and Cookies

Javascript JavaScript language (comp.lang.javascript)


Discuss Safari and Cookies in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
James M. Rodenbeck
 
Posts: n/a

Default Safari and Cookies - 09-25-2003 , 02: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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.