예제 #1
0
  /**
   * Returns the current session.
   *
   * <p>XXX: duplicated in RequestAdapter
   *
   * @param create true if a new session should be created
   * @return the current session
   */
  private SessionImpl createSession(boolean create) {
    SessionManager manager = getSessionManager();

    if (manager == null) return null;

    String id = getSessionId();

    long now = Alarm.getCurrentTime();

    SessionImpl session = manager.createSession(create, this, id, now, isSessionIdFromCookie());

    if (session != null
        && (id == null || !session.getId().equals(id))
        && manager.enableSessionCookies()) {
      setSessionId(session.getId());
    }

    // server/0123 vs TCK
    /*
    if (session != null)
      session.setAccessTime(now);
      */

    return session;
  }
예제 #2
0
 /** Returns the session cookie. */
 protected final String getSessionCookie(SessionManager manager) {
   if (isSecure()) return manager.getSSLCookieName();
   else return manager.getCookieName();
 }