Pages

Tuesday, July 26, 2011

Joomla logout Button or Link, Joomla1.6 or Joomla1.7

Joomla 1.5 Logout Link

<a href="index.php?option=com_user&task=logout&return=Lw">Log Out</a>

In Joomla 1.5 make a menu-item type 'url' to 
If you want to create a "log out" button or link for users, here is the easiest way. Create a new menu of “External Link” type. Then, set its access level to "Registered" and give it any name you want like “Logout.” In the “Link” text box type the following “index.php?option=com_user&task=logout&return=Lw”.


Joomla 1.6 or Joomla 1.7 Logout Link

Hello Everyone,
I found a solution, If you want to create a "log out" button in Joomla 1.6 or Joomla 1.7, override the joomla token in get method:

<a href="index.php?option=com_users&task=user.logout&<?php echo JUtility::getToken(); ?>=1&return=<?php echo base64_encode($this->baseurl); ?>">LOGOUT</a>

It's works like a charm.

I hope it's help you. Please comments on it and share it.

5 comments:

  1. Nice post Mehta saab.. Hare Krishnaa

    ReplyDelete
  2. Great !! Metha... Worked as promised.
    Could you please tell me how can i go to disired page after logged out ?

    ReplyDelete
  3. Thanks a lot for sharing. Exactly what i was looking for.

    ReplyDelete