This topic is locked
[SOLVED]

 Session UserID not working

7/15/2018 12:14:32 AM
PHPRunner General questions
need2sleep authorDevClub member

I've tried a few options and can't seem to store the UserID from "After successful login" event. I used to be able to use

$_SESSION["UsernameID"]=$data["ID"];


The manual shows a few options but not for ID.
Any suggestions?

ruzgarajans 7/15/2018

hi,

there is no problem in my project. it works..

field name control : UserID UsernameID

need2sleep authorDevClub member 7/15/2018



hi,

there is no problem in my project. it works..

field name control : UserID UsernameID


Tried both but no luck. Shows up as "null"
Using 9.8 30772

HJB 7/15/2018

"null" = no login happened. Anyway, from https://xlinesoft.com/phprunner/docs/save_user_data_in_session_variables.htm

I understand that the red values to be changed must be identical ...

need2sleep authorDevClub member 7/15/2018



"null" = no login happened. Anyway, from https://xlinesoft.com/phprunner/docs/save_user_data_in_session_variables.htm

I understand that the red values to be changed must be identical ...


I was up all night and realized I pasted the

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

portion of the script as well hahahaha.
Now I figured out. The null made me realize the variable never got passed through.
Thanks guys

R
ringlis1 7/19/2018

When I use UserID, it produces the Username. How to have it show the unique ID number?

admin 7/19/2018

Use Security API:

https://xlinesoft.com/phprunner/docs/secapi_current_user_data.htm

$userData = Security::currentUserData();


After that $userData["ID"] will contain ID field value from the login table.