actually i am working on java ee6 web application i tried to set value and max age for the cookie...but i was uanble to set maxage what ever the max age value i give .it shows as -1.but my browser accepts and stores cookie.<br><br>
Cookie sa=new Cookie("ssample", "welcome");
actually in the same request only when i check...it shows <b>maxage value=-1</b>....but the remaining the value are updated and properly display
Edited by: insipire on Aug 29, 2012 3:22 PM
Edited by: insipire on Aug 29, 2012 3:25 PM
A maxage of -1 indicates that its a browser cookie i.e. the cookie lasts as long as the browser which is usually the preferred approach for sessions. You have a bug somewhere in your code or the application server has some settings which kicks in when the response is sent.