This topic is locked
[SOLVED]

phprunner 10.5 and Session Variable issues

4/22/2021 10:55:22 PM
PHPRunner Tips and Tricks
W
wfcentral author

I have this in my events...

function AfterSuccessfulLogin($username, $password, $data)
{
$SESSION["test"] = 'testing';
$_SESSION["user_ID"] = $data["user_ID"];
$_SESSION["username"] = $username;
}

As I understand this should load these variables into the session so I can access them from anywhere else in the application. It did not seem to be working so just to test I put a custom code snippet at the top of a list page like this...

echo "Testing Value is ".$_SESSION["test"];
echo "Your User ID is ".$_SESSION["user_ID"];
echo "PHPR username is ".$_SESSION["username"];

when I access that list page I get everything EXCEPT the session variables.

I've been going through the forum and help files for over an hour and don't see what I'm doing wrong.

Myr0n 4/22/2021

instesd of

$SESSION["test"] = 'testing';

write

$_SESSION["test"] = 'testing';
W
wfcentral author 4/22/2021

that typo was only in the forum- in the actual program I do have _SESSION

W
wfcentral author 4/23/2021

I figured it out...

I was actually including

function AfterSuccessfulLogin($username, $password, $data)
{

}

in my code and that is part of phprunner system... once I removed those it worked.