Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x

This commit is contained in:
Joakim Erdfelt 2020-09-22 08:44:25 -05:00
commit e9208fa86e
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
4 changed files with 37 additions and 19 deletions

View File

@ -23,7 +23,8 @@ Sessions are a concept within the Servlet API which allow requests to store and
include::session-architecture.adoc[]
include::session-sessionidmgr.adoc[]
include::session-sessionhandler.adoc[]
include::session-sessioncache.adoc[]
include::session-sessiondatastore.adoc[]
include::session-sessiondatastore-file.adoc[]
include::session-cachingsessiondatastore.adoc[]
include::session-cachingsessiondatastore.adoc[]

View File

@ -32,6 +32,8 @@ import org.eclipse.jetty.server.session.NullSessionCache;
import org.eclipse.jetty.server.session.NullSessionCacheFactory;
import org.eclipse.jetty.server.session.NullSessionDataStore;
import org.eclipse.jetty.server.session.SessionCache;
import org.eclipse.jetty.server.session.SessionHandler;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.webapp.WebAppContext;
public class SessionDocs
@ -70,6 +72,38 @@ public class SessionDocs
}
}
public void servletContextWithSessionHandler()
{
//tag:schsession[]
Server server = new Server();
ServletContextHandler context = new ServletContextHandler(server, "/foo", ServletContextHandler.SESSIONS);
SessionHandler sessions = context.getSessionHandler();
//make idle sessions valid for only 5mins
sessions.setMaxInactiveInterval(300);
//turn off use of cookies
sessions.setUsingCookies(false);
server.setHandler(context);
//end::schsession[]
}
public void webAppWithSessionHandler()
{
//tag:wacsession[]
Server server = new Server();
WebAppContext context = new WebAppContext();
SessionHandler sessions = context.getSessionHandler();
//make idle sessions valid for only 5mins
sessions.setMaxInactiveInterval(300);
//turn off use of cookies
sessions.setUsingCookies(false);
server.setHandler(context);
//end::wacsession[]
}
public void defaultSessionCache()
{
//tag::defaultsessioncache[]

View File

@ -179,7 +179,6 @@ public class SessionHandler extends ScopedHandler
protected String _sessionPath;
protected int _maxCookieAge = -1;
protected int _refreshCookieAge;
protected boolean _nodeIdInSessionId;
protected boolean _checkingRemoteSessionIdEncoding;
protected String _sessionComment;
protected SessionCache _sessionCache;
@ -961,22 +960,6 @@ public class SessionHandler extends ScopedHandler
_sessionCache = cache;
}
/**
* @return true if the cluster node id (worker id) is returned as part of the session id by {@link HttpSession#getId()}. Default is false.
*/
public boolean isNodeIdInSessionId()
{
return _nodeIdInSessionId;
}
/**
* @param nodeIdInSessionId true if the cluster node id (worker id) will be returned as part of the session id by {@link HttpSession#getId()}. Default is false.
*/
public void setNodeIdInSessionId(boolean nodeIdInSessionId)
{
_nodeIdInSessionId = nodeIdInSessionId;
}
/**
* Remove session from manager
*

View File

@ -92,7 +92,7 @@
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.6.0</version>
<version>2.6.2</version>
</dependency>
</dependencies>
</project>