Package io.undertow.server.session

Examples of io.undertow.server.session.SessionManager.createSession()


                sb.append("<a href='/destroySession'>Destroy Session</a>");
                sb.append("<br/>");

                Session session = sm.getSession(exchange, sessionConfig);
                if (session == null)
                    session = sm.createSession(exchange, sessionConfig);

                sb.append("<ul>");
                for (String string : session.getAttributeNames()) {
                    sb.append("<li>" + string + " : "
                            + session.getAttribute(string) + "</li>");
View Full Code Here


                Map<String, Deque<String>> reqParams = exchange
                        .getQueryParameters();
                Session session = sm.getSession(exchange, sessionConfig);
                if (session == null)
                    session = sm.createSession(exchange, sessionConfig);

                Deque<String> deque = reqParams.get("attrName");
                Deque<String> dequeVal = reqParams.get("value");
                session.setAttribute(deque.getLast(), dequeVal.getLast());
View Full Code Here

                        .getAttachment(SessionManager.ATTACHMENT_KEY);
                SessionConfig sessionConfig = exchange
                        .getAttachment(SessionConfig.ATTACHMENT_KEY);
                Session session = sm.getSession(exchange, sessionConfig);
                if (session == null)
                    session = sm.createSession(exchange, sessionConfig);
                session.invalidate(exchange);

                exchange.setResponseCode(StatusCodes.TEMPORARY_REDIRECT);
                exchange.getResponseHeaders().put(Headers.LOCATION, "/");
                exchange.getResponseSender().close();
View Full Code Here

                @Override
                public void handleRequest(final HttpServerExchange exchange) throws Exception {
                    final SessionManager manager = exchange.getAttachment(SessionManager.ATTACHMENT_KEY);
                    Session session = manager.getSession(exchange, sessionConfig);
                    if (session == null) {
                        session = manager.createSession(exchange, sessionConfig);
                        session.setAttribute(COUNT, 0);
                    }
                    Integer count = (Integer) session.getAttribute(COUNT);
                    exchange.getResponseHeaders().add(new HttpString(COUNT), count.toString());
                    session.setAttribute(COUNT, ++count);
View Full Code Here

                @Override
                public void handleRequest(final HttpServerExchange exchange) throws Exception {
                    final SessionManager manager = exchange.getAttachment(SessionManager.ATTACHMENT_KEY);
                    Session session = manager.getSession(exchange, sessionConfig);
                    if (session == null) {
                        session = manager.createSession(exchange, sessionConfig);
                        session.setAttribute(COUNT, 0);
                    }
                    Integer count = (Integer) session.getAttribute(COUNT);
                    exchange.getResponseHeaders().add(new HttpString(COUNT), count.toString());
                    session.setAttribute(COUNT, ++count);
View Full Code Here

                        @Override
                        public void handleRequest(final HttpServerExchange exchange) throws Exception {
                            final SessionManager manager = exchange.getAttachment(SessionManager.ATTACHMENT_KEY);
                            Session session = manager.getSession(exchange, sessionConfig);
                            if (session == null) {
                                session = manager.createSession(exchange, sessionConfig);
                                session.setAttribute(COUNT, 0);
                            }
                            Integer count = (Integer) session.getAttribute(COUNT);
                            exchange.getResponseHeaders().add(new HttpString(COUNT), count.toString());
                            session.setAttribute(COUNT, ++count);
View Full Code Here

            @Override
            public void handleRequest(final HttpServerExchange exchange) throws Exception {
                final SessionManager manager = exchange.getAttachment(SessionManager.ATTACHMENT_KEY);
                Session session = manager.getSession(exchange, sessionConfig);
                if (session == null) {
                    session = manager.createSession(exchange, sessionConfig);
                    session.setAttribute(COUNT, 0);
                }
                Integer count = (Integer) session.getAttribute(COUNT);
                exchange.getResponseHeaders().add(new HttpString(COUNT), count.toString());
                session.setAttribute(COUNT, ++count);
View Full Code Here

            Session session = sessionManager.getSession(exchange, c);
            if (session != null) {
                httpSession = new HttpSessionImpl(session, this, getDeployment().getApplicationListeners(), exchange, false);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
            } else if (create) {
                final Session newSession = sessionManager.createSession(exchange, c);
                httpSession = new HttpSessionImpl(newSession, this, getDeployment().getApplicationListeners(), exchange, true);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
                getDeployment().getApplicationListeners().sessionCreated(httpSession);
            }
        }
View Full Code Here

            Session session = sessionManager.getSession(exchange, c);
            if (session != null) {
                httpSession = HttpSessionImpl.forSession(session, this, false);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
            } else if (create) {
                final Session newSession = sessionManager.createSession(exchange, c);
                httpSession = HttpSessionImpl.forSession(newSession, this, true);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
            }
        }
        return httpSession;
View Full Code Here

            Session session = sessionManager.getSession(exchange, c);
            if (session != null) {
                httpSession = HttpSessionImpl.forSession(session, this, false);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
            } else if (create) {
                final Session newSession = sessionManager.createSession(exchange, c);
                httpSession = HttpSessionImpl.forSession(newSession, this, true);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
            }
        }
        return httpSession;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.