logout using POST

45 views
Skip to first unread message

Tomas Schertel

unread,
Aug 30, 2012, 5:33:18 PM8/30/12
to we...@googlegroups.com
Maybe it is a dummy question, but how can I create a logout from my application using POST verb?
Using GET, I have a session.kill().

Thanks.

Shannon Cruey

unread,
Aug 30, 2012, 7:35:02 PM8/30/12
to we...@googlegroups.com
Are you saying session.kill in a post doesn't work?

I have that in a post, but I see some weirdness. What's your specific issue?


--
You received this message because you are subscribed to the Google Groups "web.py" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webpy/-/JzdEmW9qVGEJ.
To post to this group, send email to we...@googlegroups.com.
To unsubscribe from this group, send email to webpy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webpy?hl=en.

Andrey Kuzmin

unread,
Aug 31, 2012, 3:39:57 AM8/31/12
to we...@googlegroups.com
Have you tried something like this:

<form method="post" action="/logout"><button type="submit">logout</button></form>

class logout:
    def POST(self):
        session.kill()
        raise web.seeother("/")

Tomas Schertel

unread,
Aug 31, 2012, 7:50:52 AM8/31/12
to we...@googlegroups.com
I'll try that.
Today I use href="/logout" to logout.

Thanks.
Reply all
Reply to author
Forward
0 new messages