session.setId(newSessionId);
@Override public void changeSessionId(Session session) { session.setId(UUID.randomUUID().toString()); }
/** * Change the session ID of the current session to a new randomly generated * session ID. * * @param session The session to change the session ID for */ @Override public void changeSessionId(Session session) { session.setId(generateSessionId()); }
/** * Change the session ID of the current session to a new randomly generated * session ID. * * @param session The session to change the session ID for */ public void changeSessionId(Session session) { session.setId(generateSessionId()); }
/** * Change the session ID of the current session to a new randomly generated * session ID. * * @param session The session to change the session ID for */ public void changeSessionId(Session session, Random random) { session.setId(generateSessionId(random)); }
/** * Change the session ID of the current session to a new randomly generated * session ID. * * @param session The session to change the session ID for */ public void changeSessionId(Session session) { session.setId(generateSessionId()); }
/** * Change the session ID of the current session to a new randomly generated * session ID. * * @param session The session to change the session ID for */ @Override public void changeSessionId(Session session) { session.setId(generateSessionId()); }
/** * Change the session ID of the current session to a new randomly generated * session ID. * * @param session The session to change the session ID for */ @Override public void changeSessionId(Session session) { session.setId(generateSessionId()); }
public void changeSessionId(Session session) { // FIXME: Eventually support session id change // FIXME: (disabled by default right now, so this should not be called for now) session.setId(getNextId()); }
protected void changeSessionId(Session session, String newId, boolean notifySessionListeners, boolean notifyContainerListeners) { String oldId = session.getIdInternal(); session.setId(newId, false); session.tellChangedSessionId(newId, oldId, notifySessionListeners, notifyContainerListeners); }
protected void changeSessionId(Session session, String newId, boolean notifySessionListeners, boolean notifyContainerListeners) { String oldId = session.getIdInternal(); session.setId(newId, false); session.tellChangedSessionId(newId, oldId, notifySessionListeners, notifyContainerListeners); }
protected void changeSessionId(Session session, String newId, boolean notifySessionListeners, boolean notifyContainerListeners) { String oldId = session.getIdInternal(); session.setId(newId, false); session.tellChangedSessionId(newId, oldId, notifySessionListeners, notifyContainerListeners); }
@Override public void changeSessionId(Session session) { log.trace(String.format("EXEC changeSessionId(%s);", session)); String oldId = session.getIdInternal(); session.setId(generateSessionId(), false); String newId = session.getIdInternal(); container.fireContainerEvent(Context.CHANGE_SESSION_ID_EVENT, new String[]{oldId, newId}); }
/** * Change the session ID of the current session to a new randomly generated * session ID. * * @param session The session to change the session ID for */ @Override public void changeSessionId(Session session) { String oldId = session.getIdInternal(); session.setId(generateSessionId(), false); String newId = session.getIdInternal(); container.fireContainerEvent(Context.CHANGE_SESSION_ID_EVENT, new String[] {oldId, newId}); }
/** * Change the session ID of the current session to a new randomly generated * session ID. * * @param session The session to change the session ID for */ @Override public void changeSessionId(Session session) { String oldId = session.getIdInternal(); session.setId(generateSessionId(), false); String newId = session.getIdInternal(); container.fireContainerEvent(Context.CHANGE_SESSION_ID_EVENT, new String[] {oldId, newId}); }
@Test public void saveJedisConnectionException() throws UnsupportedEncodingException { Session session = new StandardSession(this.manager); session.setId("test-id"); doThrow(new JedisConnectionException("test-message")) .when(this.jedisClient) .set(anyString(), anyString(), any((byte[].class)), eq(session.getMaxInactiveInterval())); this.store.save(session); }
/** * Construct and return a new session object, based on the default * settings specified by this Manager's properties. The session * id will be assigned by this method, and available via the getId() * method of the returned session. If a new session cannot be created * for any reason, return <code>null</code>. * Hercules: modified * * @exception IllegalStateException if a new session cannot be * instantiated for any reason */ public Session createSession() { // Recycle or create a Session instance Session session = null; session = createEmptySession(); //always lock session.lockForeground(); // Initialize the properties of the new session and return it session.setNew(true); session.setValid(true); session.setCreationTime(System.currentTimeMillis()); session.setMaxInactiveInterval(this.maxInactiveInterval); String sessionId = generateSessionId(session); session.setId(sessionId); sessionCounter++; return (session); }
@Override public Session createSession(String sessionId) { if ((maxActiveSessions >= 0) && (getActiveSessions() >= maxActiveSessions)) { rejectedSessions++; throw new TooManyActiveSessionsException( sm.getString("managerBase.createSession.ise"), maxActiveSessions); } // Recycle or create a Session instance Session session = createEmptySession(); // Initialize the properties of the new session and return it session.setNew(true); session.setValid(true); session.setCreationTime(System.currentTimeMillis()); session.setMaxInactiveInterval(getContext().getSessionTimeout() * 60); String id = sessionId; if (id == null) { id = generateSessionId(); } session.setId(id); sessionCounter++; SessionTiming timing = new SessionTiming(session.getCreationTime(), 0); synchronized (sessionCreationTiming) { sessionCreationTiming.add(timing); sessionCreationTiming.poll(); } return session; }
@Test public void load() throws IOException { Session session = new StandardSession(this.manager); session.setId("test-id"); byte[] response = this.sessionSerializationUtils.serialize(session); when(this.jedisClient.get("test-id")).thenReturn(response); Session result = this.store.load("test-id"); assertEquals(session.getId(), result.getId()); }
@Test public void save() throws IOException { Session session = new StandardSession(this.manager); session.setId("test-id"); this.store.save(session); verify(this.jedisClient).set(getRedisSessionId(session), SESSIONS_KEY, this.sessionSerializationUtils.serialize(session), session.getMaxInactiveInterval()); }