Create a logout button in Joomla 1.5

Jun27
  • Share

Difficulty: ★☆☆☆☆

In Joomla 1.5, you need to press the logout button within the login component, to log off your session.
This logic doesn’t seem very clear for me. If I want to log-off I don’t want 2 page clicks/refreshes.

To create a logout button or menu link, you just need to invoke the logout URL part:

index.php?option=com_user&task=logout&return=Lw==

Or incase when you have Search Engine Friendly (SEF) URL’s:

/logout.html?return=Lw

Now did you note, the return=Lw== parameter?
This parameter is for bringing you back to the return page, after logging out.
The “Lw==”-value, is a Base64 encoding for “/” which brings you back to the root of the page.

Say that you don’t want to forward to the root, but to the ‘/goodbye/index.html’ page?
You will need the Base64 encoding of this string:

/logout.html?return=L2dvb2RieWUvaW5kZXguaHRtbA==

Well, here’s your help, I found a nice online Base64 converter, which does this job for you.

Check out my website to see it working in a Joomla 1.5 page.


9 Responses to “Create a logout button in Joomla 1.5”

ta, that was exactly what i was looking for, thanks

christian on July 9th, 2009 at 6:03 AM

thank you … just wish i found it earlier :)

okie on July 17th, 2009 at 3:29 PM

Lee, thanks for your information about how to create a Joomla logout button. Your method works perfectly – unlike some other posts that I read before I found yours. Thank- you very much!

Richard on August 8th, 2009 at 12:41 AM

hi.

thanks a lot.. I was looking for it.. great stuff

shakoor on May 5th, 2010 at 12:41 PM

Thx ALOT!

Romfrosk on October 27th, 2010 at 1:15 PM

Thanks, but when I logout using this code I get
Username and password do not match or you do not have an account yet
I think this message must be coming from the backend?

Any help would be appreciated.
Mika

Mika on May 17th, 2011 at 12:30 PM

thank you for explanation … just what I was looking for :D

geniutrixone on July 31st, 2011 at 11:30 PM

thank you! simple, works, added as external link to the top menu

mike nittmann on August 18th, 2011 at 2:57 AM

It doesn’t work, it gets me to opendns and the redirect link is correct. help!!!!!!

Cesar on September 21st, 2011 at 4:36 PM

Leave a comment