Cookie getMaxAge

后端 未结 4 2456
南方客
南方客 2021-02-20 01:28

I can\'t retrieve cookie maxage it always returns -1

Creating cookie:

Cookie securityCookie = new Cookie(\"sec\", \"somevalue\");
securityCookie.setMaxAg         


        
4条回答
  •  [愿得一人]
    2021-02-20 01:58

    The API says that -1 means until browser is running:

    Returns the maximum age of the cookie, specified in seconds, By default, -1 indicating the cookie will persist until browser shutdown

    What is the value of EXPIRATION_TIME constant?

提交回复
热议问题