Re: [cherrypy-users] do_logout gives 405 error

176 views
Skip to first unread message

Joseph S. Tate

unread,
May 10, 2013, 1:49:24 PM5/10/13
to cherryp...@googlegroups.com
What's the signature of your do_logout handler? Does it match the request? Especially the HTTP Method? There are only a couple of reasons a 405 happen: If you are using method dispatcher, and ask for GET, and no method is provided, the second reason is also related to HTTP Method not being allowed.


On Fri, May 10, 2013 at 11:57 AM, Alan Moore <m...@alandmoore.com> wrote:
I have an older cherrypy application that had been running on 3.1.  I am  testing it against 3.2 (Debian upgrade, basically).  It uses session_auth to authenticate users, and login still works just fine.

Logout is broken, though.  My code gives the user a "logout" hyperlink which basically points to "do_logout?from_page=.".  In 3.2 I get a 405 "Method Not Allowed" error in response to this request.  What am I doing wrong?

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-user...@googlegroups.com.
To post to this group, send email to cherryp...@googlegroups.com.
Visit this group at http://groups.google.com/group/cherrypy-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Joseph Tate

Alan Moore

unread,
May 10, 2013, 2:05:47 PM5/10/13
to cherryp...@googlegroups.com
Thanks for the response.

Sorry, I don't understand what you're asking; I just enabled session_auth in the config and (previously) it "just worked", just like do_login().  My do_login() request uses POST, maybe I should use that for do_logout()?

Joseph S. Tate

unread,
May 10, 2013, 2:21:59 PM5/10/13
to cherryp...@googlegroups.com
Yep, it looks like the do_logout request needs to be a POST. It's not-idempotent, so GET isn't appropriate.

Alan Moore

unread,
May 10, 2013, 2:58:30 PM5/10/13
to cherryp...@googlegroups.com
That was it; I created a form using the post method, and that worked.  Kind of an ugly hack, unfortunately.  Is there a way to override this behavior, or if I expose a function how would I call do_logout()?
Reply all
Reply to author
Forward
0 new messages