I am using some simple JavaScript and php to get the session info to my console like so:-

var id='<?php $s=&JFactory::getSession();echo $s->getName();?>';

The problem is this just logs out the session Name and not the Value which I would like to get. I have opened my website in both Chrome and Safari in Incognito mode and I seem to get the same Name every time, but the Value always differs for each session I create, so this is ideally what I want, as shown below:- enter image description here Currently I am getting '702d8d624abba227e9a0ac028c287b2a' logged, which is the Name, how do I get the Value of this? I have tried just about every related topic on SE and found nothing!

1 Answer 1

var id='<?php $s = JFactory::getSession(); echo $s->getId();?>';

Simple. That's enough internet for today.

For more information on accessing session information please see the Joomla Session API Documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.