Cookie getMaxAge

后端 未结 4 2388
南方客
南方客 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 02:22

    The value may be modified by the browser.

    You create a cookie and want to set a max age. The cookie is sent to the browser. The browser may reject the cookie or ignore a max age too long for its policy. This modified cookie is sent back to your application.

    Check your browser settings.

提交回复
热议问题