www.webdeveloper.com
Results 1 to 3 of 3

Thread: Writing and sending a cookie

  1. #1
    Join Date
    Sep 2005
    Posts
    2

    Question Writing and sending a cookie

    I'm sure I'm missing something.
    I trying to send a cookie with an experation time. Does anyone have a simple example.
    Thanks
    --tony

  2. #2
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    expires = new Date();
    expires.setDate(getDate()+1);
    document.cookie = name + '=' + escape(value) + '; expires=' + expires.toGMTString() + ';';

    Will set the cookie to expire in exactly one day's time.
    Stephen

  3. #3
    Join Date
    Sep 2005
    Posts
    2

    Question

    Thanks for the help.
    I'm still not getting the cookie to be sent.
    my cod. is:
    name = "test cookie";
    domain = WWW.painreliefmedia.com;
    expires = new Date();
    expires.setDate(getDate()+1);
    document.cookie = name + '=' + escape(value) + '; expires=' + expires.toGMTString(); + domain;
    <BODY>

    Would you have a simple example i can look at?
    thanks --tony

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles