On Feb 12, 8:04 pm, Slobodan Milnović <[email protected]>
wrote:

> 1. I'd like to offer logout for users. If I add an logout menu within
> the rest of the menu, and then define the function like this
>
> ;;;other menu stuff
> (list "Logout" (the-end) "logout")
>
> (defun the-end ()
>   (setf (webapp-session-value 'user) nil)
>   (weblocks:logout)

weblocks:logout likely relies on the values of *authentication-key*.
Have you modified it suitably?

In any case you don't need to call it, as it will be removed with the
session data in the next form.


>   (hunchentoot:remove-session hunchentoot:*session*))
>
> Then I get an endless loop. It seems that navigation tries to gather
> all of the submenus and their functions, but when it reaches the
> logout, it... logouts. And then starts again. What is the best way to
> make an logout function.

Not sure what's wrong here (there was also a related bug in
Hunchentoot that was fixed recently), but in my apps I usually just
remove the login data (i.e. user session value) and redirect to the
toplevel. Does that work for you?


> 2. What is the difference between
>
> ('menuitem (menu-item))
>
> and
>
> ("Menu item" (menu-item) "menuitem")?

Read the docs for make-navigation and init-navigation. :)

Then come back if you still have questions.

  Leslie

-- 
You received this message because you are subscribed to the Google Groups 
"weblocks" 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/weblocks?hl=en.

Reply via email to