• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

cookie.getMaxage() question

 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all-
How can I tell if a cookie is permanent vs. temporary?
I understand that a maxage of -1 means browser session only.
Is there a setting for permanent or is 'permanent' just a long-term persistent cookie?
thank you,
Max Tomlinson
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not aware of any method that lets you set the maxage of a cookie permanently. You can just set it to as long as you want. For one year, you can do yourCookie.setMaxAge(31526000) or yourCookie.setMaxAge(60*60*24*365). I am sure you get the idea....
 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Bosun-
Thanks for the response. So it looks like I test for maxage of -1 (temp. cookie) otherwise I have to see if it has expired.
Max
 
reply
    Bookmark Topic Watch Topic
  • New Topic