I recently installed drupal and created a user account. Then signed out of admin and logged in with the new user account. The new account does not have anything so there is not even a logout link! So basically I was stuck unable to logout. After much search there was no answer on the web. So when I did find the answer (by logging in using another browser, being too lazy to delete cookies) and looking at the link URL for logout which is http://DRUPAL_SITE_ROOT/user/logout, I decided to post it right away ... I am sure I am not the only one with this issue!

Comments

ayesh’s picture

http://DRUPAL_SITE_ROOT/logout

freefox-dupe’s picture

For me the question is more like how I can get the link back. Why did it disappear? I know that it happened when I upgraded from 6 to 7. The rest looks ok, but the logout link is gone.
Br, freefox.

ayesh’s picture

Check the menu items whether there is a "logout" item linked to /logout
if not, you'd safely add one manually.

freefox-dupe’s picture

Both /logout and /user/logout returns "The path '/logout' is either invalid or you do not have permissions." when I try to create a logout link.

The same happens when I try to logout 'manually' with http://<my_site>/?=user/logout
It returns "Access denied".

http://<my_site>/logout returns "Object not found".

More ideas, please.
Br, freefox.

freefox-dupe’s picture

This was strange, but anyhow...
I've got a multi site installation. I logged into an other site and logout out from there. That made me logged out from the first site too!
Now I could create my logout link.
Thanks for response. BR, freefox.

n3rdhack’s picture

For others out there having the same problem.
Your URL/user/logout works in Drupal 7.14.

maneesh_thakur’s picture

this worked for me, thanks

mlaw’s picture

this solution worked. thanks

ethompsy’s picture

This works for me if I substitute the logged-in username for 'user', like this:

http://<my_site>/<my_user>/logout

ie:

http://example.com/jdoe/logout

Cheers!

vm’s picture

which indicates that you are aliasing the default user path in some way.

graude’s picture

Thank you very much ! i just had the same problem and found myself very stupid !

rajeevchoudhary’s picture

Hi All,

http://your site name/user/logout

I have tested it on following version, working for following version.

drupal-7.23
drupal-7.26
drupal 7.31

Drupal multisite instance.

ninja_sort’s picture

Just had this same problem using Drupal 7.32. None of the above solutions worked.

However, this worked for me:

http://your-website-root/?q=user/logout

vm’s picture

which indicates that you don't have clean urls enabled. hence the ?q= in the path.

Jaya M’s picture

The logout option is in the User Menu. You can go to Structure->Menus and Place the User Menu block in some region.

vm’s picture

If one is still logged in you are correct. However, the opening post states that the user logged out. As such, there isn't a way to enable the menu block in any region.

Thoto’s picture

The logout link is in the administration toolbar next to the username. Therefore you need to grant the "Access administration menu" permission to the user to show the logout link.
Best,

vm’s picture

It is certainly an option but not the only option. If the preference is avoid granting extra permissions to modules or if someone isn't already using the admin menu module, the logout links provided by default are perfectly fine.

leevester’s picture

Add a new menu and place it under any Parent Menu that you want. For the path use "user/logout". Do not use a preceding "/".

If you want to logout with a menu item, insert the above line at the end of the URL in the browser. http://www.website.com/user/logout

streetracersts’s picture

With drupal 7.59 I've gotten it with /<mydomain>/user/logout

rajeevchoudhary’s picture

With drupal 8.x, same query string will work

/<mydomain>/user/logout

Pooja Chothani’s picture

thanks for your answer...

websiteworkspace’s picture

For a long term enhancement, you can consider adding a [logout] tab to user pages. 

https://www.drupal.org/project/logouttab

Additional enhancements are possible by creating site menu items that display logout versus login, depending on visitor state. The following module can implement this feature on a D8 site.

https://www.drupal.org/project/menu_item_role_access