tags:

views:

191

answers:

2

My app logs into an external service & needs to store the sessionKey (the sessionKey needs to be added to the HTTP header for future RPC calls).

What alternatives do I have for storing the sessionKey ? I've read about a scenario where the sessionKey is saved into a DIV tag on the page. Thanks for enlightening me.

A: 

As jldupont said ... use cookies.

import com.google.gwt.user.client.Cookies;

Cookies.setCookie(name, value);
Cookies.getCookie(name);
Drejc
+2  A: 

There is no need for the client side to have this information. Session management should be transparent to the client side.

The only acceptable way is to use cookies and manage this on the server side. Technically, you can throw this data on the client-side somewhere, but cookies is exactly the place for it.

Yuval A