1

Just want to understand how to implement this before I go through with it. This regards the scope of PHP session variables. I understand the concept of a 'session', of course, but what I am less clear about is whether that 'session' is global to all users of a web application (i.e. in which case if more than one user was accessing the PHP portion of a page at the same time they might start swapping/switching out variables on each other, which would not be good).

Or does a 'unique' session begin for every user every time the script is called ? In which case the 'sessions' would be isolated?

If 'session' is merely global for all users, all the time, I think I am likely better off using cookies or other methods to pass data between scripts, though the session variables method does seem so clean and tidy, otherwise.

1
  • 1
    Each client that connects to your application will get their own session. Commented Aug 13, 2022 at 9:19

1 Answer 1

2

Every user will get their own, unique session.

A visitor accessing your web site is assigned a unique id, the so-called session id. This is either stored in a cookie on the user side or is propagated in the URL.

You should read more about sessions are their concept at the PHP documentation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.