I am using Joomla 2.5.27 and I need to create a PHP and log in user's backend. .
I have the code that I got on the webs
define ('_JEXEC', 1); Define ('JPATH_BASE', the actual path (Dynaman (DIRNM (__ FILE__))); Need_once (JPATH_BASE. '/includes/defines.php'); Need_once (JPATH_BASE. '/includes/framework.php'); $ Mainframe = & amp; JFactory :: getApplication ('Admin'); $ Mainframe-> Start (); $ User = & amp; JFactory :: getUser (); $ Session = & amp; JFactory :: getSession (); Header ('content-type: application / jsan'); Echo json_encode ($ session);
The problem is that if the user is logged in the foreground, then he gives it to the logged user. But if this only logs backend, then this code gives returns to the guest user.
Can someone tell me whether it is possible to get backend sessions?
The PHP file with the code above is located in the Administrator Path
The problem is by clearing cookies from the browser It is resolved and now it is working perfectly and always working!
Comments
Post a Comment