[Lift] Re: Accessing SessionVars from inside a rewrite function?

2008-10-21 Thread David Pollak
SessionVars are not available during URL rewriting. URL rewriting takes place before the session is obtained. This is deliberate because the URL rewriting takes place before the sessionless dispatch is consulted. This happens before the session is retrieved/created and the regular flow happens.

[Lift] Re: Accessing SessionVars from inside a rewrite function?

2008-10-21 Thread Derek Chen-Becker
OK, that makes sense. Sometimes when you have a hammer everything looks like a nail :) On Tue, Oct 21, 2008 at 2:05 PM, David Pollak [EMAIL PROTECTED] wrote: SessionVars are not available during URL rewriting. URL rewriting takes place before the session is obtained. This is deliberate

[Lift] Re: Accessing SessionVars from inside a rewrite function?

2008-10-21 Thread Derek Chen-Becker
A followup question. If I want to redirect back to the original page that prompted the login redirect, how would I get that? I know I can get use S.uri to get everything but the query string, but do I need to dig deeper into the actual HttpServletRequest to get at everything after the host

[Lift] Re: Accessing SessionVars from inside a rewrite function?

2008-10-21 Thread David Pollak
object Login { def login() = { val from = S.referer.openOr(/) User.currentUser match { case Full(_) = // do nothing case _ = def testPwd(user: User, pwd: String): Can[Boolean] = if (user.password.match_?(pwd)) { if (user.invalid_?)

[Lift] Re: Accessing SessionVars from inside a rewrite function?

2008-10-21 Thread Charles F. Munat
Minor correction. findOne in the code below should be getSingleResult(). Forgot I'd changed it... Charles F. Munat wrote: This depends on HTTP_REFERER being set. It usually is, but there's no guarantee. Another way I've found is to set a SessionVar in the addDispatchBefore (or wherever