@Override public void doStart() throws Exception { sessions.clear(); super.doStart(); }
/** * Stop the session manager. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#doStop() */ @Override public void doStop() throws Exception { _sessions.clear(); _sessions = null; super.doStop(); }
if (sm instanceof AbstractSessionManager) { AbstractSessionManager asm = (AbstractSessionManager) sm; asm.setHttpOnly(true); asm.getSessionCookieConfig().setSecure(true); if (sm instanceof AbstractSessionManager) { AbstractSessionManager asm = (AbstractSessionManager) sm; asm.setHttpOnly(true); asm.getSessionCookieConfig().setSecure(true);
public HttpCookie access(HttpSession session,boolean secure) { long now=System.currentTimeMillis(); AbstractSession s = ((SessionIf)session).getSession(); if (s.access(now)) { // Do we need to refresh the cookie? if (isUsingCookies() && (s.isIdChanged() || (getSessionCookieConfig().getMaxAge()>0 && getRefreshCookieAge()>0 && ((now-s.getCookieSetTime())/1000>getRefreshCookieAge())) ) ) { HttpCookie cookie=getSessionCookie(session,_context==null?"/":(_context.getContextPath()),secure); s.cookieSet(); s.setIdChanged(false); return cookie; } } return null; }
if (isUsingCookies()) String id = getNodeId(session); HttpCookie cookie = null; if (_sessionComment == null) _cookieConfig.getMaxAge(), _cookieConfig.isHttpOnly(), _cookieConfig.isSecure() || (isSecureRequestOnly() && requestIsSecure)); _cookieConfig.getMaxAge(), _cookieConfig.isHttpOnly(), _cookieConfig.isSecure() || (isSecureRequestOnly() && requestIsSecure), _sessionComment, 1);
public HttpSession getHttpSession(String nodeId) { String cluster_id = getSessionIdManager().getClusterId(nodeId); AbstractSession session = getSession(cluster_id); if (session!=null && !session.getNodeId().equals(nodeId)) session.setIdChanged(true); return session; }
/** * Create a new HttpSession for a request */ public HttpSession newHttpSession(HttpServletRequest request) { AbstractSession session=newSession(request); session.setMaxInactiveInterval(_dftMaxIdleSecs); addSession(session,true); return session; }
final Server server=getSessionHandler().getServer(); synchronized (server) setSessionIdPathParameterName(tmp);
public void clearAttributes() { while (_attributes!=null && _attributes.size()>0) { ArrayList<String> keys; synchronized(this) { keys=new ArrayList<String>(_attributes.keySet()); } Iterator<String> iter=keys.iterator(); while (iter.hasNext()) { String key=(String)iter.next(); Object value; synchronized(this) { value=doPutOrRemove(key,null); } unbindValue(key,value); _manager.doSessionAttributeListeners(this,key,value,null); } } if (_attributes!=null) _attributes.clear(); }
public String getObjectContextBasis() { if (_managed != null && _managed instanceof AbstractSessionManager) { AbstractSessionManager manager = (AbstractSessionManager)_managed; String basis = null; SessionHandler handler = manager.getSessionHandler(); if (handler != null) { ContextHandler context = AbstractHandlerContainer.findContainerOf(handler.getServer(), ContextHandler.class, handler); if (context != null) basis = getContextName(context); } if (basis != null) return basis; } return super.getObjectContextBasis(); } }
/** * Add the session Registers the session with this manager and registers the * session ID with the sessionIDManager; */ protected void addSession(AbstractSession session, boolean created) { synchronized (_sessionIdManager) { _sessionIdManager.addSession(session); addSession(session); } if (created) { _sessionsStats.increment(); if (_sessionListeners!=null) { HttpSessionEvent event=new HttpSessionEvent(session); for (HttpSessionListener listener : _sessionListeners) listener.sessionCreated(event); } } }
/** * Tell the HttpSessionIdListeners the id changed. * NOTE: this method must be called LAST in subclass overrides, after the session has been updated * with the new id. * @see org.eclipse.jetty.server.SessionManager#renewSessionId(java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @Override public void renewSessionId(String oldClusterId, String oldNodeId, String newClusterId, String newNodeId) { if (!_sessionIdListeners.isEmpty()) { AbstractSession session = getSession(newClusterId); HttpSessionEvent event = new HttpSessionEvent(session); for (HttpSessionIdListener l:_sessionIdListeners) { l.sessionIdChanged(event, oldClusterId); } } }
public HttpCookie access(HttpSession session,boolean secure) { long now=System.currentTimeMillis(); AbstractSession s = ((SessionIf)session).getSession(); if (s.access(now)) { // Do we need to refresh the cookie? if (isUsingCookies() && (s.isIdChanged() || (getSessionCookieConfig().getMaxAge()>0 && getRefreshCookieAge()>0 && ((now-s.getCookieSetTime())/1000>getRefreshCookieAge())) ) ) { HttpCookie cookie=getSessionCookie(session,_context==null?"/":(_context.getContextPath()),secure); s.cookieSet(); s.setIdChanged(false); return cookie; } } return null; }
if (isUsingCookies()) String id = getNodeId(session); HttpCookie cookie = null; if (_sessionComment == null) _cookieConfig.getMaxAge(), _cookieConfig.isHttpOnly(), _cookieConfig.isSecure() || (isSecureRequestOnly() && requestIsSecure)); _cookieConfig.getMaxAge(), _cookieConfig.isHttpOnly(), _cookieConfig.isSecure() || (isSecureRequestOnly() && requestIsSecure), _sessionComment, 1);
@Override public HttpSession getHttpSession(String nodeId) { String cluster_id = getSessionIdManager().getClusterId(nodeId); AbstractSession session = getSession(cluster_id); if (session!=null && !session.getNodeId().equals(nodeId)) session.setIdChanged(true); return session; }
/** * Create a new HttpSession for a request */ public HttpSession newHttpSession(HttpServletRequest request) { AbstractSession session=newSession(request); session.setMaxInactiveInterval(_dftMaxIdleSecs); addSession(session,true); return session; }
final Server server=getSessionHandler().getServer(); synchronized (server) setSessionIdPathParameterName(tmp);
public void clearAttributes() { while (_attributes!=null && _attributes.size()>0) { ArrayList<String> keys; synchronized(this) { keys=new ArrayList<String>(_attributes.keySet()); } Iterator<String> iter=keys.iterator(); while (iter.hasNext()) { String key=(String)iter.next(); Object value; synchronized(this) { value=doPutOrRemove(key,null); } unbindValue(key,value); _manager.doSessionAttributeListeners(this,key,value,null); } } if (_attributes!=null) _attributes.clear(); }
public String getObjectContextBasis() { if (_managed != null && _managed instanceof AbstractSessionManager) { AbstractSessionManager manager = (AbstractSessionManager)_managed; String basis = null; SessionHandler handler = manager.getSessionHandler(); if (handler != null) { ContextHandler context = AbstractHandlerContainer.findContainerOf(handler.getServer(), ContextHandler.class, handler); if (context != null) basis = getContextName(context); } if (basis != null) return basis; } return super.getObjectContextBasis(); } }
/** * Add the session Registers the session with this manager and registers the * session ID with the sessionIDManager; */ protected void addSession(AbstractSession session, boolean created) { synchronized (_sessionIdManager) { _sessionIdManager.addSession(session); addSession(session); } if (created) { _sessionsStats.increment(); if (_sessionListeners!=null) { HttpSessionEvent event=new HttpSessionEvent(session); for (HttpSessionListener listener : _sessionListeners) listener.sessionCreated(event); } } }