Search in sources :

Example 1 with DelegatingSession

use of org.apache.shiro.session.mgt.DelegatingSession in project shiro by apache.

the class DefaultWebSessionManager method createExposedSession.

protected Session createExposedSession(Session session, SessionKey key) {
    if (!WebUtils.isWeb(key)) {
        return super.createExposedSession(session, key);
    }
    ServletRequest request = WebUtils.getRequest(key);
    ServletResponse response = WebUtils.getResponse(key);
    SessionKey sessionKey = new WebSessionKey(session.getId(), request, response);
    return new DelegatingSession(this, sessionKey);
}
Also used : ServletRequest(javax.servlet.ServletRequest) ShiroHttpServletRequest(org.apache.shiro.web.servlet.ShiroHttpServletRequest) HttpServletRequest(javax.servlet.http.HttpServletRequest) HttpServletResponse(javax.servlet.http.HttpServletResponse) ServletResponse(javax.servlet.ServletResponse) SessionKey(org.apache.shiro.session.mgt.SessionKey) DelegatingSession(org.apache.shiro.session.mgt.DelegatingSession)

Example 2 with DelegatingSession

use of org.apache.shiro.session.mgt.DelegatingSession in project shiro by apache.

the class DefaultWebSessionManager method createExposedSession.

protected Session createExposedSession(Session session, SessionContext context) {
    if (!WebUtils.isWeb(context)) {
        return super.createExposedSession(session, context);
    }
    ServletRequest request = WebUtils.getRequest(context);
    ServletResponse response = WebUtils.getResponse(context);
    SessionKey key = new WebSessionKey(session.getId(), request, response);
    return new DelegatingSession(this, key);
}
Also used : ServletRequest(javax.servlet.ServletRequest) ShiroHttpServletRequest(org.apache.shiro.web.servlet.ShiroHttpServletRequest) HttpServletRequest(javax.servlet.http.HttpServletRequest) HttpServletResponse(javax.servlet.http.HttpServletResponse) ServletResponse(javax.servlet.ServletResponse) SessionKey(org.apache.shiro.session.mgt.SessionKey) DelegatingSession(org.apache.shiro.session.mgt.DelegatingSession)

Aggregations

ServletRequest (javax.servlet.ServletRequest)2 ServletResponse (javax.servlet.ServletResponse)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 HttpServletResponse (javax.servlet.http.HttpServletResponse)2 DelegatingSession (org.apache.shiro.session.mgt.DelegatingSession)2 SessionKey (org.apache.shiro.session.mgt.SessionKey)2 ShiroHttpServletRequest (org.apache.shiro.web.servlet.ShiroHttpServletRequest)2