When site members click logout they are taken back to the homepage.

I'd like to redirect the user back to the login page but with a "You're logged out" type of message.

Is something like this possible yet?


It is not possible yet, but a quick plugin would make this possible. It would just be a controller with a logout action. You'd be able to call the action as a url with:


Then you can logout the user the same way Craft does in their controller and edit the redirect as you see fit. Something like this:


This would log them out and then send them to the homepage with a query attached to the end.

  • I've setup a simple plugin. My Controller is called DelaneyMethod_MembersControllor with an action called actionLogout. In my form I have this: delaneymethod/members/logout but I get "Page Not Found, Unable to resolve the request "delaneymethod/members/logout". – Sean Delaney Jun 19 '14 at 8:32
  • I also see you have suggested /actions/[PluginHandle]/[ControllerName]/[ActionName] and not /[PluginHandle]/[ControllerName]/[ActionName] as action URL ? – Sean Delaney Jun 19 '14 at 8:35
  • Hey Sean, Craft's controllers are triggered when the first URL segment is ‘actions’ (by default) . You can generate a URL using the actionUrl function, i.e. {{ actionUrl('delaneyMethod/members/logout') }} – Stuart Whitehead Jun 19 '14 at 9:55
  • Yes, I know but I'm submitted a form in this case... and I have an action field. – Sean Delaney Jun 19 '14 at 9:58
  • I've got it working. I was calling "delaneymethod/members/logout" not "delaneyMethod/members/logout". Simple things that the eye doesn't catch... Thanks. – Sean Delaney Jun 19 '14 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.