/**
   * Sets session information from received session object. Within the cookie only the session id
   * and expiration date is stored or updated.<br>
   * <br>
   * The {@link ClientSessionManager} listens to logout events to destroy current session
   * information.
   *
   * @param sessionInfo the session status return from server.
   */
  public static void setSessionInfo(SessionInfo sessionInfo) {
    Date expires = sessionInfo.getExpiringDate();

    // gwt sets domain automatically
    String session = sessionInfo.getSession();
    if (sessionInfo.hasUserLoginInfo()) {
      setCookie(COOKIE_SESSION_ID, session, expires, null, "/", false);
    } else {
      notLoggedInSessionId = session;
    }
  }
 /** @param sessionInfo the session info containing the user information. */
 public static void setUserInfo(SessionInfo sessionInfo) {
   loggedInUser = sessionInfo.getUsername();
   loggedInUserRole = sessionInfo.getRole();
   loggedInUserId = sessionInfo.getUserId();
 }