2010/5/7 Sripathi Krishnan <sripathikrish...@gmail.com>

> Both are identical, just different ways of doing it ...
>
> ..BUT, you almost always set the session cookie on the server. The session
> cookie has a random, impossible to guess identifier. This identifier must
> only be set on the server side, otherwise anybody can spoof sessions.
>
> If you are just setting trivial information like some user preferences,
> then you can use the client version - saves you the server trip.
>
> --Sri
>
>
>
>   On 8 May 2010 00:53, Ho Jimmy <jimmyyl...@gmail.com> wrote:
>
>>   Hi
>>
>> I am confusing on adding cookie to the client after authentication.
>>
>> 1> Add from server, transmit to client by response
>> getThreadLocalResponse.addCookie(New Cookie(....))
>>
>> 2> Add on client after receiving the RPC callback for authentication
>> success from server
>> Cookies.setCookie(....)
>>
>> What is the difference?
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Web Toolkit" group.
>> To post to this group, send email to google-web-tool...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

Hi Sri,

Thanks for your reply.
I set the session cookie from server
this.getThreadLocalResponse().addCookie(new Cookie("sid",sessId));
>From the browser, I am able to see the cookie named "sid".
However, on the client side, I check the cookie list, and the "sid" is
missing
      Collection<String> cookies = Cookies.getCookieNames();
      Iterator it = cookies.iterator();
      while(it.hasNext())
      {
       System.out.println((String)it.next());
      }

What happens?

Thanks a lot

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to