In my application, we use
java applet to write cookie on browser and use jquery to read this cookie. I tried do like tutorial but I always don't see the cookie set on my browser.
http://docs.oracle.com/javase/tutorial/deployment/doingMoreWithRIA/accessingCookies.html And here is my code: The first I create a class to handle the cookie
Then I call it in main applet (I use jquery to run this applet):
try {
cookie = new CookieAccessor();
HttpCookie cookiedata = new HttpCookie("UserName", "Jonh");
URL url = new URL(getCodeBase().toString());
cookie.add(url.toURI(), cookiedata);
} catch(Exception e) {
e.printStackTrace();
}
But I've checked the browser cookies and there's no UserName What is missing in this code?
Many thanks!