Jacques René Mesrine
Jacques René Mesrine

Reputation: 47805

GWT and storing a session key

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.

Upvotes: 2

Views: 1155

Answers (2)

Yuval Adam
Yuval Adam

Reputation: 165242

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.

Upvotes: 2

Drejc
Drejc

Reputation: 14286

As jldupont said ... use cookies.

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

Cookies.setCookie(name, value);
Cookies.getCookie(name);

Upvotes: 1

Related Questions