title: Client session management in web application on refresh of browser?
body: <p>I am working on a web application.In this application I have used GWT2.3.
  Now my question is about session in the client side.
  In client side I have maintained session like below</p>
  
  <pre><code>public class WorkFlowSessionFactory {
  private static HashMap session;
  
  private WorkFlowSessionFactory() {
  }
  
  public static HashMap getClientSessionInstance() {
      if (session == null) {
          session = new HashMap();
      }
      return session;
  }
  
  public static Object getValue(WorkFlowSesisonKey key) {
      return getClientSessionInstance().get(key);
  }
  
  public static void putValue(WorkFlowSesisonKey key, Object value) {
  
      getClientSessionInstance().put(key, value);
  }
  public static void remove(WorkFlowSesisonKey key)
  {
      getClientSessionInstance().remove(key);
  }
  
  public static void resetSessionUser(User user) {
      session.remove(WorkFlowSesisonKey.LOGGEDIN_USER);
      session.put(WorkFlowSesisonKey.LOGGEDIN_USER, user);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Now after login successfully I put logged in user in client session as well as server side 
  session like below</p>
  
  <pre><code>session.put(WorkFlowSesisonKey.LOGGEDIN_USER, user);
  </code></pre>
  
  <p>Now when I refresh browser I session instance went null.And all the session variable also null.</p>
  
  <p>One way in my mind is on refresh first I make a server hit to get a logged in user and again set
  client side session logged in user. So at many places at client side where logged in user required 
  it will work after the refresh of browser.</p>
  
  <p>But I am not sure it is a right way to do or not.
  So please suggest me this case, is there any good way to do this ?
  Thanks in advance</p>