I am trying to add cookie in ADF Faces application and i am Using the sample code
-2:
Cookie userCookie = new Cookie("myCookie", vcookie);
userCookie.setMaxAge(-1);
FacesContext ctx = FacesContext.getCurrentInstance();
((HttpServletResponse) ctx.getExternalContext().getResponse()).addCookie(userCookie);
3.
Cookie retrieveCookie = (Cookie) context.getExternalContext().getRequestCookieMap().get("myCookie");
if (retrieveCookie !=null)
System.out.println("My cookie is: "+retrieveCookie.getName()
+ " " + retrieveCookie.getValue());
found in forum
1762538
It looks like it is working okay for me in jdeveloper , but in application server It keeps my selection if I stay in and switch between pages, but if I quit browser and come back, my settings are lost. i am setting the age of 1 year myCookie.setMaxAge(60*60*24*365);
i am not sure what to change here
Thanks
Message was edited by:
Rao