Hi.
I have a wicket 1.4 application with a AuthenticatedWebSession with
authenticate(String username, String password) method. I use annotations to
allow for seeing some components : @AuthorizeAction(action = Action.RENDER,
roles = Roles.ADMIN) for example.
I want when user logs in to save a cookie and use that cookie to keep user
logged in for ever until he logs out.
I have my custom LoginPanel with user, password and remember checkbox. In
LoginPanel I use a LoginValidator like:
@Override
protected void onInitialize() {
super.onInitialize();
getForm().add(new LoginValidator(username, password, remember));
}
and in my LoginValidator, after a successful login, I do the following:
if (remember.getConvertedInput()) {
HttpServletResponse servletResponse = ((BufferedWebResponse)
RequestCycle.get().getResponse()).getHttpServletResponse();
Cookie c = new Cookie("userid", username);
servletResponse.addCookie(c);
}
My cookie is created. But I do not know WHERE to read from
HttpServletRequest to see that a cookie exists and automatically login the
user if session expired. Any clues?
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-Remember-Login-WIth-Cookie-tp4650029.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]