Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create cookie with javascript - Safari issue

    In my website I create a typical cookie, after the page has finished loading, using a javascript script using the standard way of setting cookies as found in the w3schools tutorial:
    Code:
    function setCookie(c_name,value,expiredays)
    {
    
    var exdate=new Date() exdate.setDate(exdate.getDate()+expiredays) document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
    }
    My script works an all browsers i've tested it on (firefox, internet explorer, opera) EXCEPT Safari!

    Does anyone know how to overcome this? Any suggestions are welcome!

    Thank you,
    Valanto

  • #2
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Problem resolved
    It needs for the cookies preference to be "always" since my page sets the cookie after it finishes loading and not before it loads. Also safari doesn't like cookies coming from localhost. When I tested it on another server and with cookies always enabled it worked fine!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •