Firecookie (a Firebug extension) says the cookie's Expires is Session.
When I log in Firebug's Net panel shows the following response header
(I changed the cookie name):
Set-Cookie mycookiename=Z0GZIXFRBQMVTOITYSICI1XZN23ROYLN
My code in Boot looks like this:
User.autologinFunc = Full(()=>{
for(uid <- S.findCookie(cookieName);
userId <- uid.value;
user <- User.find(net.liftweb.mapper.By(User.uniqueId, userId))
) {
User.logUserIn(user)
S.redirectTo(User.homePage)
}
}
)
User.onLogIn ::= {
case user =>
val cookie = net.liftweb.http.provider.HTTPCookie(cookieName,
user.uniqueId.is)
cookie.setMaxAge(2 * 7 * 24 * 60 * 60) // 2 weeks in seconds
S.addCookie(cookie)
}
User.onLogOut ::= {
case _ =>
S.deleteCookie(cookieName)
}
What am I doing wrong? Why is the max-age not getting set?
On Mon, Oct 12, 2009 at 3:37 PM, Ross Mellgren <[email protected]> wrote:
>
> I usually use FireBug or Safari Web Inspector to look at the Set-
> Cookie / Cookie headers going back and forth, or use the browser's
> built in cookie index (usually buried in preferences). You could also
> use something like Wireshark or tcpdump to watch the headers go by if
> you're using a browser that doesn't have debugging extensions.
>
> -Ross
>
> On Oct 12, 2009, at 3:15 PM, Naftoli Gugenheim wrote:
>
> > I'm writing an app in Lift that uses cookies to remember the user as
> > logged in. When I run it from my local computer, and when I run it
> > from the server and view it from my local computer, it works fine.
> > But from my client's computer it doesn't work (it seems to expire
> > with the session). How can I debug this?
> > Thanks.
> >
> >
> > >
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---