Hello i am trying to use cookie at my site. I used this code for set the cookie
try{
Cookie cookie1 = new Cookie("thesiteid", Integer.toString(site_id));
cookie1.setDomain("localhost");
cookie1.setPath("/");
cookie1.setMaxAge(24*60*60*365);
response.addCookie(cookie1);
System.err.println("Set cookie");
}
catch (Exception e){
System.err.println("Error in creating the cookie: "+e.getMessage());
}
The problem is that is not working at chrome and i am not sure if it does not work to other versions of IE. How i can make a more universal create cookie?
Thank you very much