Friday, March 7, 2014

Re: com.google.gwt.user.client.Cookies.setCookie(.....). is failing with DNS Name

I think this is the expected behavior (from browsers, GWT just passes the value around).
But because you want the cookie to be sent to the current domain (only? or do you have subdomains too?) you can just pass 'null' there, and the cookie won't have a ";domain=" attribute.

On Thursday, March 6, 2014 7:38:44 PM UTC+1, ram.pam...@gmail.com wrote:
Hi,
I am using Gwt-2.5.1.
I am setting sessionId to cookies using com.google.gwt.user.client.Cookies.setCookie(.....).
For this I used following code. 

String baseDomain = com.google.gwt.user.client.Window.Location.getHostName();  
 Date cookieDate = new Date();                               
 cookieDate.setDate(cookieDate.getDate() + 1);                               
 Cookies.setCookie("dsessionId", LoginInfo.getSessionId(), cookieDate, baseDomain, "/", false); 

Cookie is not able to create with domain name, it is failing.
I have not seen the cookie called "dsessionId" in list of browser cookies.
This issue is happening only when the host URL having DNS name like http://testMyApps:8085/SampleApp/
here Domain Name : testMyApps
No issue  observed when host URL is having IP Address like http://172.29.241.22:8085/SampleApp/

How can I set a cookie with all the above parameters.

Please provide a solution for this issue.

Thanks 
Mohan

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment