Package org.eclipse.jetty.server.session

Examples of org.eclipse.jetty.server.session.HashSessionManager


        context.setContextPath(contextName);
        // bind the jetty http handler with the context handler
        if (isSessionSupport) {        
            // If we have sessions, we need two handlers.
            if (sessionManager == null) {
                sessionManager = new HashSessionManager();
                HashSessionIdManager idManager = new HashSessionIdManager();
               
                try {
                    //for JETTY 7.5
                    sessionManager.getClass().getMethod("setSessionIdManager", SessionIdManager.class)
View Full Code Here


    protected Server createStaticResourcesServer(Server server, ServletContextHandler context, String home) throws Exception {

        context.setContextPath("/");

        SessionManager sm = new HashSessionManager();
        SessionHandler sh = new SessionHandler(sm);
        context.setSessionHandler(sh);

        if (home != null) {
            String[] resources = home.split(":");
View Full Code Here

        context.setContextPath(contextName);
        // bind the jetty http handler with the context handler
        if (isSessionSupport) {        
            // If we have sessions, we need two handlers.
            if (sessionManager == null) {
                sessionManager = new HashSessionManager();
                HashSessionIdManager idManager = new HashSessionIdManager();
                sessionManager.setIdManager(idManager);
            }
            SessionHandler sessionHandler = new SessionHandler(sessionManager);
            if (securityHandler != null) {
View Full Code Here

        context.setContextPath(contextName);
        // bind the jetty http handler with the context handler
        if (isSessionSupport) {        
            // If we have sessions, we need two handlers.
            if (sessionManager == null) {
                sessionManager = new HashSessionManager();
                HashSessionIdManager idManager = new HashSessionIdManager();
               
                try {
                    //for JETTY 7.5
                    sessionManager.getClass().getMethod("setSessionIdManager", SessionIdManager.class)
View Full Code Here

    if (sm instanceof HashSessionManager) {
      ((HashSessionManager)sm).setStoreDirectory(new File(storeDir));
      return ;
    }
   
    HashSessionManager hsm = new HashSessionManager();
    hsm.setStoreDirectory(new File(storeDir));
    SessionHandler sh = new SessionHandler();
    sh.setSessionManager(hsm);
    webApp.setSessionHandler(sh);
  }
View Full Code Here

        context.setContextPath(contextName);
        // bind the jetty http handler with the context handler
        if (isSessionSupport) {        
            // If we have sessions, we need two handlers.
            if (sessionManager == null) {
                sessionManager = new HashSessionManager();
                HashSessionIdManager idManager = new HashSessionIdManager();
               
                try {
                    //for JETTY 7.5
                    sessionManager.getClass().getMethod("setSessionIdManager", SessionIdManager.class)
View Full Code Here

        context.setContextPath(contextName);
        // bind the jetty http handler with the context handler
        if (isSessionSupport) {        
            // If we have sessions, we need two handlers.
            if (sessionManager == null) {
                sessionManager = new HashSessionManager();
                HashSessionIdManager idManager = new HashSessionIdManager();
               
                try {
                    //for JETTY 7.5
                    sessionManager.getClass().getMethod("setSessionIdManager", SessionIdManager.class)
View Full Code Here

    protected Server createStaticResourcesServer(Server server, ServletContextHandler context, String home) throws Exception {

        context.setContextPath("/");

        SessionManager sm = new HashSessionManager();
        SessionHandler sh = new SessionHandler(sm);
        context.setSessionHandler(sh);

        if (home != null) {
            String[] resources = home.split(":");
View Full Code Here

  private Duration idleSavePeriod = Duration.hours(2);
  private Duration savePeriod = Duration.minutes(5);
  private Duration scavengePeriod = Duration.minutes(5);

  public SessionManager build() throws IOException {
    HashSessionManager manager = new HashSessionManager();
    manager.setSessionTrackingModes(ImmutableSet.of(SessionTrackingMode.COOKIE));
    manager.setHttpOnly(true);
    manager.getSessionCookieConfig().setHttpOnly(true);
    manager.setDeleteUnrestorableSessions(true);

    manager.setStoreDirectory(new File(getPath()));
    manager.getSessionCookieConfig().setMaxAge((int) cookieMaxAge.toSeconds());
    manager.setRefreshCookieAge((int) cookieRefreshAge.toSeconds());
    manager.setMaxInactiveInterval((int) maxInactiveInterval.toSeconds());
    manager.setIdleSavePeriod((int) idleSavePeriod.toSeconds());
    manager.setSavePeriod((int) savePeriod.toSeconds());
    manager.setScavengePeriod((int) scavengePeriod.toSeconds());
    return manager;
  }
View Full Code Here

    JPAWebConfigurer configurer = new JPAWebConfigurer();
    configurer.setContext(context);
    contextHandler.addEventListener(configurer);
   
    // Create the SessionHandler (wrapper) to handle the sessions
    HashSessionManager manager = new HashSessionManager();
    SessionHandler sessions = new SessionHandler(manager);
    contextHandler.setHandler(sessions);
   
    return contextHandler;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.session.HashSessionManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.