protected void cookieSet() { try (Lock lock = _lock.lock()) { _sessionData.setCookieSet(_sessionData.getAccessed()); } } /* ------------------------------------------------------------ */
data.setVhost(vhost); data.setLastNode(lastNode); data.setCookieSet(cookieSet); data.setExpiry(expiry); data.setMaxInactiveMs(maxIdle);
result.getLong(_sessionTableSchema.getLastAccessTimeColumn()), result.getLong(_sessionTableSchema.getMaxIntervalColumn())); data.setCookieSet(result.getLong(_sessionTableSchema.getCookieTimeColumn())); data.setLastNode(result.getString(_sessionTableSchema.getLastNodeColumn())); data.setLastSaved(result.getLong(_sessionTableSchema.getLastSavedTimeColumn()));
@Override public SessionData read(ObjectDataInput in) throws IOException { String id = in.readUTF(); String contextPath = in.readUTF(); String vhost = in.readUTF(); long accessed = in.readLong(); long lastAccessed = in.readLong(); long created = in.readLong(); long cookieSet = in.readLong(); String lastNode = in.readUTF(); long expiry = in.readLong(); long maxInactiveMs = in.readLong(); SessionData sd = new SessionData(id, contextPath, vhost, created, accessed, lastAccessed, maxInactiveMs); ByteArrayInputStream bais = new ByteArrayInputStream(in.readByteArray()); try (ClassLoadingObjectInputStream ois = new ClassLoadingObjectInputStream(bais)) { SessionData.deserializeAttributes(sd, ois); } catch(ClassNotFoundException e) { throw new IOException(e); } sd.setCookieSet(cookieSet); sd.setLastNode(lastNode); sd.setExpiry(expiry); return sd; }
/** * Copy the info from the given sessiondata * * @param data the sessiondata to be copied */ public void copy (SessionData data) { if (data == null) return; //don't copy if no data if (data.getId() == null || !(getId().equals(data.getId()))) throw new IllegalStateException ("Can only copy data for same session id"); if (data == this) return; //don't copy ourself setLastNode(data.getLastNode()); setContextPath(data.getContextPath()); setVhost(data.getVhost()); setCookieSet(data.getCookieSet()); setCreated(data.getCreated()); setAccessed(data.getAccessed()); setLastAccessed(data.getLastAccessed()); setMaxInactiveMs(data.getMaxInactiveMs()); setExpiry(data.getExpiry()); setLastSaved(data.getLastSaved()); clearAllAttributes(); putAllAttributes(data.getAllAttributes()); }
session.setContextPath(contextPath); session.setVhost(vhost); session.setCookieSet(cookieSet); session.setLastNode(lastNode); session.setLastSaved(lastSaved);