I need to create a button to log out in Joomla, I mean, the user usually enter the session but then must press the button I created to close this session, I know how to check if any user has entered the session and I know how to display the button, what I don’t know is how to make that button close the actual user session (log out).
This is the base code I have:
<?php $user =& JFactory::getUser(); ?>
<?php if ( ($user->id)==0 ) : ?>
//***code for not opened session***
<?php else : ?>
<form id="form1" name="form1" method="post" action="">
<input type="button" name="button" id="button" value="Close Session" />
</form>
<?php endif ?>
How to make that button to close the joomla 2.5 session, I checked the API page but i didn’t find it.
Use this link –