How can data from Joomla sessions table be accessed?

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
EiriniK
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Mar 10, 2021 8:56 am

How can data from Joomla sessions table be accessed?

Post by EiriniK » Wed Mar 10, 2021 9:08 am

We have a Joomla site and we would like to use the Session in order to track the user activity and the pages that they have vistited inside the website. We have a sessions table in the Database inside PhpAdmin, but how can we read the data that are saved there?
The code we are using in our php file is this one:
<?php

define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../..' ));

require_once ( JPATH_BASE. '/includes/defines.php' );
require_once ( JPATH_BASE. '/includes/framework.php' );
$mainframe = JFactory::getApplication('site');
$mainframe->initialise();

$session = JFactory::getSession();
$session->set('current_page', $_SERVER['REQUEST_URI']);

$session = JFactory::getSession();
echo $session->get('name');
?>
Last edited by toivo on Wed Mar 10, 2021 11:08 am, edited 1 time in total.
Reason: mod note: moved from 3.x General Questions, retitled

Locked

Return to “Joomla! 3.x Coding”