Related questions about the session

Source: Internet
Author: User
Questions about the session
Premise:
Scripting language: php/server: Linux
Server-side use a $_session["login"] and $_session["username"] to record whether the user login and user name

The problem is as follows:
A1/A2 refers to the newly opened Browse window ( Note: Is the newly opened window, not the label)

Scenario 1: A user logged in to the browser A1 on PC A but did not exit. Set $_session["Login"] = "true"; $_session["username"] = "A";
At this time the browser A2 on Computer A has an identical or different user exit. Set $_session["Login"] = "false" and unset ($_session["username"])

Question 1: What is the value of the browser A1 user's $_session["login" on computer A? is the value of $_session["username" still in?

Scenario 2: There is a user logged on in the browser on PC A, but not exited. Set $_session["Login"] = "true"; $_session["username"] = "A";
At this point the browser on computer B has an identical or different user exit. Set $_session["Login"] = "false" and unset ($_session["username"])

2: What is the value of $_session["login" for the browser on computer A? is the value of $_session["username" still in?

Question 3: The above problem is that the server side only with a session key also records the value, the different client will not operate on the other client impact.

100 points online and other answers

Thank you!

Share to: more


------Solution--------------------
Each independent browser process will produce a session key
Note: Multi-tab browsers count only one process

Other questions, you'll know when you move.
------Solution--------------------
You can think that a browser can only log on to a user, log in or out of a tab or window, refresh another window will also sync
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.