Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:16:15+00:00 2026-06-06T10:16:15+00:00

setMaxAge is supposed to control the maximum age of a cookie, so if my

  • 0

setMaxAge is supposed to control the maximum age of a cookie, so if my intention is to literally set the maximum age possible the logical thing would be doing:

cookie.setMaxAge(Integer.MAX_VALUE);

However this results in no Expires in cookie HTTP header at all, I’m testing it on a WebSphere 7. Setting it to something like 1 year measured in seconds works fine.

Why is that happening?

PS
Have just tested on Tomcat7 – Integer.MAX_VALUE results in Max-Age=2147483647; Expires=Wed, 06-Mar-2080 21:30:32 GMT, so it must be something wrong with WebSphere.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:16:17+00:00Added an answer on June 6, 2026 at 10:16 am

    Problem is described in http://www-01.ibm.com/support/docview.wss?uid=swg1PM34869.
    Cause is a kind of millenium problem: WAS7 writes cookies date as YY, WAS6 as YYYY

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a cookie which is generated from a servlet and that I would
Cookie usernameCookie = new Cookie (username, attributeUsername); usernameCookie.setMaxAge(24*60*60); response.addCookie(usernameCookie); A cookie is created in
This my code for setting new cookie Cookie citizen = new Cookie(citizen,email); citizen.setMaxAge(3600); response.addCookie(citizen);
I am creating a cookie in a jsp script, which is located at: www.myproject.com/login/index.jsp
I am trying to delete a the value cookie that I created after a
I'm redirecting the user to some URL and I want to send a cookie
In my jsp file I am setting a cookie I want to persist for
How do you remove a cookie in a Java servlet? I tried this: http://www.jguru.com/faq/view.jsp?EID=42225
So, I'm trying to use the cookie plugin (seen here: http://grails.org/plugin/cookie ), and overall,
I need to set a auto increment for a field in my table. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.