Question

I have a login page at myhost:8080/auth/login after I logged in I set a cookie by my home controller class which is at 'myhost:8080/home/

I am setting my cookie like this

 Cookie myCookie =  new Cookie("__JSSESSIONID", request.getSession().getId());
 myCookie.setPath("/");
 response.addCookie(myCookie);

but when I see it via firebug, it shows me the path "/home". I want to set cookie on root path so that can ready from other places.

No correct solution

OTHER TIPS

Here is what you need:

<Context ... sessionCookiePath="/" > ... </Context>

Check tomcat documentation for more details

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top