javascript - set cookie on local host -


i have done quite researches on topic, answers got cookie not work on localhost since cookie expects domain contain @ least 2 dots. question is, since asp.net websecurity class able set authentication cookie server side, , javascript able set cookie on client side when using localhost domain. there must way it, know how done server side.

update: trying java server.

cookie tokencookie = new cookie("token", token); /* work if include line , use 127.0.0.1 access page usernamecookie.setdomain("127.0.0.1"); */ tokencookie.setpath("/"); response.addcookie(tokencookie); return response.ok().build(); 

i have no idea why there 2 people trying close question duplicate. please read people, said know reason why cookie not being set, know , want know how!!!


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -