Question

Listed below are the values that are saved in the $_SESSION array when a user is...

Listed below are the values that are saved in the $_SESSION array when a user is authenticated: $loggedin = $_SESSION['loggedin']; $accountid = $_SESSION['accountid']; $userDisplay = $_SESSION['userDisplay']; $username = $_SESSION['username']; $email = $_SESSION['email'];

Briefly explain the purpose of each of the five variables ($loggedin, $accountid, $userDisplay, $username, $email) and give an example of where each variable is used

0 0
Add a comment Improve this question Transcribed image text
Answer #1

($loggedin, $accountid, $userDisplay, $username, $email)

These values are retrived using the session variable, which means, these values are available across all the pages on the website wherever the session is maintained.
Hence, In order to show a user profile picture along with its name and email, $userDisplay, $username, $email is kept. $loggedIn is a boolean, which describes whether the user is currently loggedIn or not. So if a particular section is only meant for registered usees, then $loggedIn can be used to provide the access to that section.

Similarly, $accountid can be a attribute which should be sent to server on each request, so that server gets to know which user is making a particular request and if the request is a valid request.

**************************************************

Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.

Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.

Add a comment
Know the answer?
Add Answer to:
Listed below are the values that are saved in the $_SESSION array when a user is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT