Joomla 2.5 check user logged in

How do i check if a user is logged in in Joomla 2.5? I can only seem to find code snippets for the older versions of joomla. Is it the same?

Answers:

Answer
if(JFactory::getUser()->id)
{
//user has logged in
}
Answer

Yes it same as before try this-

$user =& JFactory::getUser();
if($user->id!=0){
//user is logged in
}
Answer
$user = JFactory::getUser()->guest;

If you are on PHP 5.3.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.