On Feb 24, 11:09 am, dave <dpdear...@gmail.com> wrote: > On Feb 24, 10:33 am, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote: > > > > > > > On Wed, Feb 24, 2010 at 7:21 PM, dave <dpdear...@gmail.com> wrote: > > > Further investigation leads me to believe that each pathway is either > > > working in a different session or that Lift just doesn't know about my > > > application's session. > > > > S.inStatefulScope_? returns true from the Lift pathway and false from > > > my own. > > > > I'll keep following this path, but, being a Lift newbie, any pointers > > > or tips to speed me along would be appreciated. > > > What is "your own" path way? Is it a browser request or a request from > > another servlet? If the latter, make sure you provide any session > > cookies/url parameters needed to correctly propagate the container > > session to lift. > > > This of course is also needed if it's a browser request, but if it's a > > request within the same web app, this should be handled > > automatically.... > > > /Jeppe > > Thanks Jeppe, > > The pathway that doesn't work is when trying to call logUserIn from my > own non-Lift servlet. We have the web.xml LiftFilter pointing to a > subfolder that doesn't contain that servlet so it is not in the Lift > session. > > I've just tried moving the LiftFilter to the full /* url-pattern > (instead of the previous /subfolder/*) and setting > LiftRules.passNotFoundToChain = true, but this is causing "Client did > not send n bytes as expected" errors on the regular servlet. > > Prior to calling logUserIn from my servlet, is it possible to manually > initialize Lift's S.session? I see S.initIfUninitted, but where/how > would I get a LiftSession?
Progress, but still having some trouble. I've managed to sync up the Lift session with my Servlet session using SessionMaster.getSession to load the existing LiftSession, but this only works if I visit my http://domain.com/subfolder/user_mgt first, causing Lift to automatically create the initial LiftSession. If that session does not exist, I'm using LiftRules.sessionCreator to create a new LiftSession with my Servlet session (as shown below). In theory I think this should work--when I visit /subfolder/user_mgt/* it has the same session ID, but I think it may be creating a new LiftSession instead of using the existing one because the curUserId is Empty. Any thoughts/tips? Thanks!! val ls = SessionMaster.getSession(Request.session.getId, Empty) S.initIfUninitted(ls.openOr(LiftRules.sessionCreator( new provider.servlet.HTTPServletSession(Request.session), ""))) { User.logUserIn(user) } -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.