This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hey! If I for example use the following code in a JSP page: Cookie cookie = new Cookie("t", "v"); cookie.setMaxAge(60 * 60); //1 h in seconds response.addCookie(cookie); Will I be able to access a cookie named "t" next time I visit this site (if it's within an hour)? Or do I have to do something to actually set the cookie? I can't get it to work.. Please help...:-) //Tom
Do you need to specify the domain and/or the path for the cookie? I'm not sure if the response will take care of that when you call addCookie(). Otherwise, I don't see anything wrong with this. (Sorry, I'm not much help here -- I haven't had too much experience with cookies in JSP.)