php - Accessing session data outside Joomla -
I'm trying to run an application outside of Joomla (not in the form of a plugin) and I'm logged in user's Want to use information (user id) I'm thinking how should I go about doing this? Is there a file in which I can join? I tried to use $ _SESSION but it appears blank.
Is there a simple solution to my problem? Thanks for your time.
Actually it seems as easy as not. Joomla comes with its unique session-ID-generation and some encryption in place, using handheld sessions, so the only way to get Joomla session data is to use the appropriate Joomla functions (as suggested by other suggestions). To do. There was a recent project where we needed to move a Joomla certified user in a separate application. We did this by adding a Joomla adapter which provides the Joomla user class immediately, the user reads the data, puts everything in an encrypted cookie and redirects back to our application. There we read encrypted cookies, instantiate our own user objects and discard the cookie. Since this is not 100% secure, we are changing the system to write user data in a database table and read it from our application - we avoid insecure way through a cookie because this cookie is encrypted (and in this Sensitive user information that is sufficient to authenticate a user) it will be transferred to the wire and can smell.
Define ('_JEXEC', 1); Define ('JPATH_BASE', dirname (dirname (__ FILE__))); Define ('d', DIRECTORY_SEPARATOR); Need_once (JPATH_BASE DS 'contains' DS 'defines.php'); Need_once (JPATH_BASE.Ds 'contains' DS 'framework.php'); $ Mainframe = JFTC :: Mill Application ('Site');
The above basic script is required to access the Joomla resources.
Comments
Post a Comment