3.9 PHP 7.1 Get Guest Session

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

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Nov 01, 2005 4:51 pm

3.9 PHP 7.1 Get Guest Session

Post by dangling » Fri May 24, 2019 4:21 pm


I am trying to redirect to my proxy using sorcerer inside an article as follows.

Code: Select all

header("Location: https://www.abc.com/compare/?page=compare". "&token=" . $session->getId()."&end", TRUE, 303);
This works for a logged user but not for a guest. For a guest I get an error
Call to a member function getId() on null.
I am trying to test if user returns to page so need to know if guest has session so I can reload a record in my application.
Last edited by toivo on Fri May 24, 2019 4:29 pm, edited 1 time in total.
Reason: mod note: moved to 3.x Coding

Joomla! Enthusiast
Joomla! Enthusiast
Posts: 228
Joined: Fri Oct 13, 2017 8:00 pm

Re: 3.9 PHP 7.1 Get Guest Session

Post by CDXXonline » Sat Jun 01, 2019 12:30 am

Seems like you need to add a null case and direct it to do something other than give you an error. If null do this (whatever this will be, maybe get ip?) else your code.



Return to “Joomla! 3.x Coding”