Package com.caucho.server.session

Examples of com.caucho.server.session.SessionManager


    return getSession(false);
  }
 
  public HttpSession getSession(boolean create)
  {
    SessionManager manager = getSessionManager();
   
    setVaryCookie(getCookieName(manager));

    HttpSession session = super.getSession(create);
View Full Code Here


    return session;
  }

  public String getRequestedSessionId()
  {
    SessionManager manager = getSessionManager();
   
    setVaryCookie(getCookieName(manager));

    String id = super.getRequestedSessionId();
View Full Code Here

    return id;
  }

  public boolean isRequestedSessionIdValid()
  {
    SessionManager manager = getSessionManager();
   
    setVaryCookie(getCookieName(manager));

    boolean isValid = super.isRequestedSessionIdValid();
View Full Code Here

    return isValid;
  }

  public boolean isRequestedSessionIdFromCookie()
  {
    SessionManager manager = getSessionManager();
   
    setVaryCookie(getCookieName(manager));

    boolean isValid = super.isRequestedSessionIdFromCookie();
    if (isValid)
View Full Code Here

    return isValid;
  }

  public boolean isRequestedSessionIdFromURL()
  {
    SessionManager manager = getSessionManager();

    setVaryCookie(getCookieName(manager));

    boolean isValid = super.isRequestedSessionIdFromURL();
   
View Full Code Here

                              HttpServletResponse response)
  {
    if (webApp == null)
      return;

    SessionManager manager = webApp.getSessionManager();
    String value = manager.createCookieValue();

    Cookie cookie = new Cookie("resinauthid", value);
    cookie.setVersion(1);

    long cookieMaxAge = 365L * 24L * 3600L * 1000L;
 
View Full Code Here

   * @return the current session
   */
  @Override
  public HttpSession getSession(boolean create)
  {
    SessionManager manager = null;

    if (_webApp != null)
      manager = _webApp.getSessionManager();

    if (manager != null)
      setVaryCookie(manager.getCookieName());

    if (_session != null && _session.isValid()) {
      setHasCookie();

      return _session;
View Full Code Here

   *
   * @return the current session
   */
  private SessionImpl createSession(boolean create, boolean hasOldSession)
  {
    SessionManager manager = getSessionManager();

    String id = getRequestedSessionId();

    long now = Alarm.getCurrentTime();

    SessionImpl session;

    if (id != null && id.length() > 6) {
      session = manager.getSession(id, now, create,
                                   isRequestedSessionIdFromCookie());
      if (session == null) {
      }
      else if (session.isValid()) {
        if (session != null)
          setHasCookie();
        if (! session.getId().equals(id) && manager.enableSessionCookies()) {
          HttpServletResponse response = getResponse();

          if (response instanceof CauchoResponse)
            ((CauchoResponse) getResponse()).setSessionId(session.getId());
        }

        return session;
      }
    }
    else
      id = null;

    if (! create)
      return null;

    // Must accept old ids because different webApps in the same
    // server must share the same cookie
    //
    // But, if the session group doesn't match, then create a new
    // session.

    session = manager.createSession(id, now, this,
                                    isRequestedSessionIdFromCookie());

    if (session != null)
      setHasCookie();

    if (session.getId().equals(id))
      return session;

    if (manager.enableSessionCookies()) {
      HttpServletResponse response = getResponse();

      if (response instanceof CauchoResponse)
        ((CauchoResponse) getResponse()).setSessionId(session.getId());
    }
View Full Code Here

  public Cookie []getCookies()
  {
    if (_cookiesIn == null) {
      _cookiesIn = _request.getCookies();

      SessionManager sessionManager = getSessionManager();
      String sessionCookieName = getSessionCookie(sessionManager);

      for (int i = 0; i < _cookiesIn.length; i++) {
        Cookie cookie = _cookiesIn[i];

        if (cookie.getName().equals(sessionCookieName)
          && sessionManager.isSecure()) {
          cookie.setSecure(true);
          break;
        }
      }
View Full Code Here

   * vary: JSESSIONID.
   */
  @Override
  public String getRequestedSessionId()
  {
    SessionManager manager = getSessionManager();

    if (manager != null && manager.enableSessionCookies()) {
      setVaryCookie(getSessionCookie(manager));

      String id = findSessionIdFromCookie();

      if (id != null) {
        _isSessionIdFromCookie = true;
        setHasCookie();
        return id;
      }
    }

    String id = findSessionIdFromUrl();
    if (id != null) {
      return id;
    }

    if (manager != null && manager.enableSessionCookies())
      return null;
    else
      return _request.findSessionIdFromConnection();
  }
View Full Code Here

TOP

Related Classes of com.caucho.server.session.SessionManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.