6
lurch
8y

I hate code imperfections. I have a cookie which is linked to a permanent user setting and I was looking to make it infinite, but I was disappointed to find out the best option is Cookie.setMaxAge(int seconds), so I put Integer.MAX_VALUE, and I'm not as disappointed anymore.

Comments
  • 0
    What happens when the user deletes the cookies?
  • 0
    They get a new session, and their unique settings return to their defaults. No biggie; and I mean, if you delete all browser cookies, you should know you were taking that risk.
  • 0
    Any reason you could update the expiration date when they logged in each time?
    Or first load?

    I guess this does require them visiting often though
    Maybe implement both 😋
  • 2
    @itsdaniel0

    That's actually a really good point. And I'd hope it would work and people would be logging in more frequently than every 68 years...
  • 1
    @lurch Yeah, you'd like to think so 😂
Add Comment