Re: redirectToInterceptPage,continueToOriginalDestination and cookies
Hi, Don't know about a best practice but what comes to me is to implement continue... yourself: static void continueToOriginalDestination() { InterceptData data = InterceptData.get(); if (data != null) { data.continueOk = true; String url = RequestCycle.get().getUrlRenderer().renderUrl(data.originalUrl); // RequestCycle.get().replaceAllRequestHandlers(new RedirectRequestHandler(url)); --commented this and use different request handler RequestCycle.get().replaceAllRequestHandlers(new RedirectWithCookieRequestHandler(url)); } } public class RedirectWithCookieRequestHandler extends RedirectRequestHandler { private Cookie rememberMeCookie; @Override public void respond(IRequestCycle requestCycle) { HttpServletRequest request = ((ServletWebRequest) requestCycle.getRequest()). getContainerRequest(); StringBuilder builder = new StringBuilder(); //generic set cookie code: builder.append(cookie.getName()).append(=).append(cookie.getValue()); builder.append(;Path=).append(cookie.getPath()); builder.append(; HttpOnly); if (cookie.getSecure()) { builder.append(; Secure); } response.setHeader(SET-COOKIE, builder.toString()); super.respond(requestCycle); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/redirectToInterceptPage-continueToOriginalDestination-and-cookies-tp4662074p4662085.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: redirectToInterceptPage,continueToOriginalDestination and cookies
Hi, Please create a quickstart application and attach it to a ticket in Jira. We should improve this. On Fri, Nov 1, 2013 at 1:11 PM, wen zhang itc...@gmail.com wrote: Hi, In the JavaDoc of Component.html#redirectToInterceptPage, it says Redirects browser to an intermediate page such as a sign-in page. . In my sign-in page, I want to store cookies for implementing 'remember me'. And I also want to use continueToOriginalDestination to return to the previous page. The problem is that continueToOriginalDestination will reset the response and clear all the cookies. Is there any 'best practice'?
redirectToInterceptPage,continueToOriginalDestination and cookies
Hi, In the JavaDoc of Component.html#redirectToInterceptPage, it says Redirects browser to an intermediate page such as a sign-in page. . In my sign-in page, I want to store cookies for implementing 'remember me'. And I also want to use continueToOriginalDestination to return to the previous page. The problem is that continueToOriginalDestination will reset the response and clear all the cookies. Is there any 'best practice'?