Page 1 of 1

3.9 PHP 7.1 Get Guest Session

Posted: Fri May 24, 2019 4:21 pm
by dangling
Hello,

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

Code: Select all

<?php
header("Location: https://www.abc.com/compare/?page=compare". "&token=" . $session->getId()."&end", TRUE, 303);
die();
?>
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.
Thanks
Paul

Re: 3.9 PHP 7.1 Get Guest Session

Posted: Sat Jun 01, 2019 12:30 am
by CDXXonline
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.