is it ok to use Joomla\Session\Session

60 views
Skip to first unread message

Ganesh Kumar

unread,
Nov 2, 2015, 6:11:31 PM11/2/15
to Joomla! Framework Development
Hello,  

I am trying to use Session package from Joomla.

Here is my code.

$session = new Session;
$session->set('test', 'Testing');
echo $session->get('test');

With this code, I got no error and no output.

Please shed some light on where I am messing it.

BTW.  I hope Session package is not deprecated at-least for next 6 months. 

Ganesh

Ganesh Kumar

unread,
Nov 2, 2015, 6:19:52 PM11/2/15
to Joomla! Framework Development
Sorry, my bad. 

I am initiating it again as new Session.  But I already have a session variable declared in my App.php file.
So  I tried in my controller with:
$session=$this->getApplication()->getSession();

$session->set('test', 'Testing');
echo $session->get('test');

Its working good.   Find my own solution. just after posting here. Lol. 

Ganesh
Reply all
Reply to author
Forward
0 new messages