Package de.srsoftware.tools
Klasse SessionToken
java.lang.Object
de.srsoftware.tools.Cookie
de.srsoftware.tools.SessionToken
a special cookies allowing to keep track of a session
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSessionToken(String sessionId) create a new sessoin token cookie carrying the given session idSessionToken(String sessionId, String path, Instant expiration, boolean trust) create a new sessoin token cookie carrying the given session id -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung<T extends Cookie>
Tadd this cookie instance to a Headers objectstatic Optional<SessionToken> from(HttpExchange ex) extract the session token from an HttpExchangereturn the string carried by this session token instance
-
Konstruktordetails
-
SessionToken
create a new sessoin token cookie carrying the given session id- Parameter:
sessionId- a string to provide as sesstionToken cookiepath- the path this cookie is valid forexpiration- the time when the cookie is about to expiretrust- whether the cookie shall be persistent
-
SessionToken
create a new sessoin token cookie carrying the given session id- Parameter:
sessionId- a string to provide as sesstionToken cookie
-
-
Methodendetails
-
addTo
Beschreibung aus Klasse kopiert:Cookieadd this cookie instance to a Headers object -
from
extract the session token from an HttpExchange- Parameter:
ex- the exchange to extract from- Gibt zurück:
- an optional carrying a session token, if one was submitted in the exchange
-
sessionId
return the string carried by this session token instance- Gibt zurück:
- the carried id
-