Folks,
An unfortunate construct developed in Lift related to using LoanWrappers to perform functions associated with a request (e.g., testing for cookie availability) and potentially modifying SessionVar state related to cookie availability. The Lift libraries used this pattern (e.g. ProtoExtendedSession).
As we've extended the S scope around stateless requests (including stateless REST requests), the problems with this pattern became apparent.
I've updated LiftRules with two new rules:
/**
* Execute certain functions early in a Stateful Request
*/
val earlyInStateful = RulesSeq[Box[Req] => Unit]
/**
* Execute certain functions early in a Stateful Request
*/
val earlyInStateless = RulesSeq[Box[Req] => Unit]
Any request-sniffing/state modifying functions should be placed in one of these two locations and removed from S.addAround/LoanWrappers.
I have updated ProtoExtendedSession. The key change you need to make in Boot.scala if you're using ProtoExtendedSession is:
remove:
S.addAround(ExtendedSession.requestLoans)
insert:
LiftRules.earlyInStateful.append(ExtendedSession.testCookieEarlyInStateful)
The complete ticket is described here:
https://www.assembla.com/spaces/liftweb/tickets/939-protoextended-session-uses-bad-construct#last_comment
I have also put together a small sample application of using ExtendedLogin correctly:
https://github.com/dpp/starting_point/tree/extended_login
Sorry for the inconvenience.
Thanks,
David
--
Lift, the simply functional web framework
http://liftweb.net