I am using cookie to avoid havind SID (session id). I try to set the cookie using the following method and retrieve it in my jsp file as shown blew, but it does not work. it just shows HelloSESSIONID.
Java
public class Users {
public void setcookie(){
Cookie user = new Cookie("User","Miro");
user.setMaxAge(60*60);
}
Jsp
<%@ page language="java"%>
<% Cookie cookies[] = request.getCookies();
for (int i=0; i<cookies.length; i++)
{
out.println("Hello"+cookies[i].getName()+ "> ");
}
%>