I just did a little test:
1. When redering page1 I'm setting a cookie. I'm also rendering a link
like:
SHtml.link(/page2, () = {
S.deleteCookie(marius)
}, Text(Got to /page1 and remove cookie))
2. When I click the link page2 is rendered and in the HTTP header I am
seeing the
Your code looks fine to me. There is notmagic withXHtml.link just that
when you click the link on server-side your function gets called
before the /logout page gets rendered.
Can you add a function to LiftRules.onEndServicing ?
LiftRules.onEndServicing.append {
case (req, Full(resp)) =
val
Thank you for the debugging clue (very handy function; I can see
myself using that in other situations).
What I see when the logout link is followed is:
List()
When I set the cookie originally, I do see a List(HTTPCookie(...))
I'm running all of this on 127.0.0.1:8080.
Thanks
Richard
On
I've made some progress with this. By changing my link to go to a
different page, I do see the cookie being removed.
So by going from...
SHtml.link(/logout, LoginContext.logout, spanLogout/span )
to
SHtml.link(/blank, LoginContext.logout, spanLogout/span )
It works: the cookie is deleted