Did you know that if a web server sends a HTTP 302 (redirect) response, with a set-cookie, the browser won’t take the cookie unless the cookie’s path is set to “/” ?
This is how it can be set in Java (servlet):
Cookie cookie = new Cookie("cookie_name","cookie_value");
cookie.setMaxAge(30000); // expiry
cokie.setPath("/"); // this is the magic
I thought cookies are simple but in truth they are not. You never know what you will learn until you actually try to do it in anger. So there