Cookie Domain contains Dot?

Viewed 7174

I use the Cookies class of GWT to generate cookies.

When I use the following

Cookies.setCookie(LOGIN_COOKIE_NAME, value, expires);

everything works fine. Checking the cookie in the browser leads to mydomay.com as it should.

But, when I use the following:

String path = "/"
String domain = "mydomain.com"
Cookies.setCookie(LOGIN_COOKIE_NAME, value, expires, domain, path, secure);

I can see a dot before the domain when I check it in my browser:

.mydomain.com

Where does the dot comes from?

It turns out that Cookies.removeCookie(LOGIN_COOKIE_NAME) does not work for me if .mydomain.com is given. Why is it not possible to delete this cookie when there is a dot in front?

4 Answers
Related