This discussion is archived
3 Replies Latest reply: Aug 29, 2012 3:55 AM by ramp RSS

unable to set max for cookie

819867 Newbie
Currently Being Moderated
hai <br>
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>
<i>
"
Cookie sa=new Cookie("ssample", "welcome");
sa.setMaxAge(120);
response.addCookie(sa);
"</i>

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points