-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I'd like to be able to get cookie information at the start of the session but the request object (Executions.getCurrent().getNativeRequest()) is null. Here is the code I'm using:
public class SessionInitiator implements SessionInit { public void init(Session sn, Object o) throws Exception { //no request variable to access yet, can't access cookies from here Cookie[] cookies = ((HttpServletRequest) Executions.getCurrent().getNativeRequest()).getCookies(); } }
Any ideas?
Nobody...?
Just so you know why I want to get cookies in my SessionInit: I'd like to be able to see if a user is "remembered" with cookies, and if so update a last visited date in my database, rather than doing so at user login.
If you look at the Javadoc, you'll see that the method signature is:
void init(Session sess, java.lang.Object request)
Asked: 2011-10-18 21:53:18 +0800
Seen: 223 times
Last updated: Oct 20 '11