How to pass own user data to check for the session

49 views Asked by At

I am working on a group project where my group member is working on the user part while I am working in the post ads, view ads i.e. other parts of the project. I want to create fake users which will determine the admin and user through the session . Is there a way to do this? Thank you very much.

1

There are 1 answers

0
DrRoach On

It depends on how you are going to detect if a user is signed in, I usually create a couple of sessions depending on the results of a SQL request. If you are going down this route, you can temporarily add these sessions to the top of your files, like so:

$_SESSION['user'] = 'admin';

You can then use these session later in your code to make sure the user is signed in and to get their username ect.