*
The moose likes JSF and the fly likes Cookie maxAge problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Cookie maxAge problem" Watch "Cookie maxAge problem" New topic
Author

Cookie maxAge problem

Predrag Ristic
Greenhorn

Joined: Dec 07, 2009
Posts: 28
I have a simple Seam applikacion created in Eclipse.I'm trying to track down user's session using cookies.You can see in pages.xml what methods from manage bean are invoked on each page.After I enter username on the login page,appropriate cookie is created and the login_success page is displayed.There is also a check box which determines max age of the username cookie(if checked cookie's max age is set to a large value).I've noticed,during debugging,if the check box is checked,at first,username cookie is set properly but on the login_success page when GetLogged() method is invoked,cookie max age is -1(will be deleted at the end of the session) instead of a much larger value.
Another curious thing occurs,when the check box is not checked,the cookie is still in the browser even its max age before the browser's closing was -1 and it shouldn't be there after reopenning of the browser.

Login.xhtml:


LoginBeanAction.java


pages.xml:


GetCurrentUlr() updates cookie containg last visited page.

Any suggestions?Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cookie maxAge problem
 
Similar Threads
servlet not finding the cookies set by previous jsp page?
jsf and jstl
Cookies being read even after deleting
Cookies example in HFSJ
HTTP Status 403 - Access to the requested resource has been denied