Package io.undertow.server.session

Examples of io.undertow.server.session.Session.removeAttribute()


    }

    protected void handleRedirectBack(final HttpServerExchange exchange) {
        final Session session = Sessions.getSession(exchange);
        if (session != null) {
            final String location = (String) session.removeAttribute(LOCATION_ATTRIBUTE);
            if(location != null) {
                exchange.addDefaultResponseListener(new DefaultResponseListener() {
                    @Override
                    public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                        FormAuthenticationMechanism.sendRedirect(exchange, location);
View Full Code Here


            if(request != null) {
                if(request.requestUri.equals(exchange.getRequestURI()) && exchange.isRequestComplete()) {
                    UndertowLogger.REQUEST_LOGGER.debugf("restoring request body for request to %s", request.requestUri);
                    exchange.setRequestMethod(request.method);
                    Connectors.ungetRequestBytes(exchange, new ImmediatePooled<ByteBuffer>(ByteBuffer.wrap(request.data, 0, request.dataLength)));
                    underlyingSession.removeAttribute(SESSION_KEY);
                    //clear the existing header map of everything except the connection header
                    //TODO: are there other headers we should preserve?
                    Iterator<HeaderValues> headerIterator = exchange.getRequestHeaders().iterator();
                    while (headerIterator.hasNext()) {
                        HeaderValues header = headerIterator.next();
View Full Code Here

    }

    protected void handleRedirectBack(final HttpServerExchange exchange) {
        final Session session = Sessions.getSession(exchange);
        if (session != null) {
            final String location = (String) session.removeAttribute(LOCATION_ATTRIBUTE);
            if(location != null) {
                exchange.addDefaultResponseListener(new DefaultResponseListener() {
                    @Override
                    public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                        FormAuthenticationMechanism.sendRedirect(exchange, location);
View Full Code Here

            if(request != null) {
                if(request.requestUri.equals(exchange.getRequestURI()) && exchange.isRequestComplete()) {
                    UndertowLogger.REQUEST_LOGGER.debugf("restoring request body for request to %s", request.requestUri);
                    exchange.setRequestMethod(request.method);
                    Connectors.ungetRequestBytes(exchange, new ImmediatePooled<>(ByteBuffer.wrap(request.data, 0, request.dataLength)));
                    underlyingSession.removeAttribute(SESSION_KEY);
                    //clear the existing header map of everything except the connection header
                    //TODO: are there other headers we should preserve?
                    Iterator<HeaderValues> headerIterator = exchange.getRequestHeaders().iterator();
                    while (headerIterator.hasNext()) {
                        HeaderValues header = headerIterator.next();
View Full Code Here

                        if (System.getSecurityManager() == null) {
                            session = httpSession.getSession();
                        } else {
                            session = AccessController.doPrivileged(new HttpSessionImpl.UnwrapSessionAction(httpSession));
                        }
                        session.removeAttribute(ATTRIBUTE_NAME);
                    }
                    break;
            }
        }
View Full Code Here

            if(request != null) {
                if(request.requestUri.equals(exchange.getRequestURI())) {
                    UndertowLogger.REQUEST_LOGGER.debugf("restoring request body for request to %s", request.requestUri);
                    exchange.setRequestMethod(request.method);
                    Connectors.ungetRequestBytes(exchange, new ImmediatePooled<ByteBuffer>(ByteBuffer.wrap(request.data, 0, request.dataLength)));
                    underlyingSession.removeAttribute(SESSION_KEY);
                }
            }
        }
    }
View Full Code Here

                        if (System.getSecurityManager() == null) {
                            session = httpSession.getSession();
                        } else {
                            session = AccessController.doPrivileged(new HttpSessionImpl.UnwrapSessionAction(httpSession));
                        }
                        session.removeAttribute(ATTRIBUTE_NAME);
                    }
                    break;
            }
        }
View Full Code Here

                if (System.getSecurityManager() == null) {
                    session = httpSession.getSession();
                } else {
                    session = AccessController.doPrivileged(new HttpSessionImpl.UnwrapSessionAction(httpSession));
                }
                session.removeAttribute(ATTRIBUTE_NAME);
            }
        }

    }
View Full Code Here

            if(request != null) {
                if(request.requestUri.equals(exchange.getRequestURI()) && exchange.isRequestComplete()) {
                    UndertowLogger.REQUEST_LOGGER.debugf("restoring request body for request to %s", request.requestUri);
                    exchange.setRequestMethod(request.method);
                    Connectors.ungetRequestBytes(exchange, new ImmediatePooled<ByteBuffer>(ByteBuffer.wrap(request.data, 0, request.dataLength)));
                    underlyingSession.removeAttribute(SESSION_KEY);
                    //clear the existing header map of everything except the connection header
                    //TODO: are there other headers we should preserve?
                    Iterator<HeaderValues> headerIterator = exchange.getRequestHeaders().iterator();
                    while (headerIterator.hasNext()) {
                        HeaderValues header = headerIterator.next();
View Full Code Here

                        if (System.getSecurityManager() == null) {
                            session = httpSession.getSession();
                        } else {
                            session = AccessController.doPrivileged(new HttpSessionImpl.UnwrapSessionAction(httpSession));
                        }
                        session.removeAttribute(ATTRIBUTE_NAME);
                    }
                    break;
            }
        }
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.