public boolean isRequestedSessionIdValid() { if (isHttpSessions()) { return super.isRequestedSessionIdValid(); } else { Boolean value = (Boolean) getAttribute(REFERENCED_SESSION_ID_IS_VALID); return (value != null && value.equals(Boolean.TRUE)); } }
public String getRequestedSessionId() { String requestedSessionId = null; if (isHttpSessions()) { requestedSessionId = super.getRequestedSessionId(); } else { Object sessionId = getAttribute(REFERENCED_SESSION_ID); if (sessionId != null) { requestedSessionId = sessionId.toString(); } } return requestedSessionId; }
public boolean isRequestedSessionIdFromCookie() { if (isHttpSessions()) { return super.isRequestedSessionIdFromCookie(); } else { String value = (String) getAttribute(REFERENCED_SESSION_ID_SOURCE); return value != null && value.equals(COOKIE_SESSION_ID_SOURCE); } }
public boolean isRequestedSessionIdFromURL() { if (isHttpSessions()) { return super.isRequestedSessionIdFromURL(); } else { String value = (String) getAttribute(REFERENCED_SESSION_ID_SOURCE); return value != null && value.equals(URL_SESSION_ID_SOURCE); } }
public HttpSession getSession(boolean create) { HttpSession httpSession; if (isHttpSessions()) { httpSession = super.getSession(false); if (httpSession == null && create) { //Shiro 1.2: assert that creation is enabled (SHIRO-266): if (WebUtils._isSessionCreationEnabled(this)) { httpSession = super.getSession(create); } else { throw newNoSessionCreationException(); } } } else { boolean existing = getSubject().getSession(false) != null; if (this.session == null || !existing) { Session shiroSession = getSubject().getSession(create); if (shiroSession != null) { this.session = new ShiroHttpSession(shiroSession, this, this.servletContext); if (!existing) { setAttribute(REFERENCED_SESSION_IS_NEW, Boolean.TRUE); } } else if (this.session != null) { this.session = null; } } httpSession = this.session; } return httpSession; }