SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast MSWD's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help determining when cookie is set to expire

    First I know nothing about .js!

    Can you tell from this little snippet when the cookie is set to expire?

    this.set_cookie(kw_cookie, new_kw, 86400 * 365);

    Does the 365 indicate 1 year?

    If you wanted it to expire in say 30 days, would it say 30 days there.

    If I have the wrong snippet please let me know and I can copy and paste the thing in it's entirety.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by MSWD View Post
    First I know nothing about .js!

    Can you tell from this little snippet when the cookie is set to expire?

    this.set_cookie(kw_cookie, new_kw, 86400 * 365);

    Does the 365 indicate 1 year?
    60 * 60 * 24 = 86400 which is one day, so multiplying by 365 would be for one year.

    Quote Originally Posted by MSWD View Post
    If you wanted it to expire in say 30 days, would it say 30 days there.
    Yes.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast MSWD's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks so much for the confirmation. I appreciate it.


Tags for this Thread

Bookmarks

Posting Permissions

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