Sessionid changes with browser and user login

Lionsure 2020-08-16 Original by the website

Sessionid is the number used by the server to identify the identity of the client browser, just like a person's ID card. When a user visits the website for the first time, the server will assign a unique sessionid to the user's browser; from the second visit to the website, the server will use this sessionid to identify the user until the user closes the browser.

If different users in the same browser(such as ie) login to the same website, do they have the same sessionid; on the same computer and different browsers login to the same website, do they have the same sessionid? The following examples are used to verify.

 

1. The sessionid does not change with the change of the user(same browser)

Open a website with the IE browser, first login with the username TestId1, the sessionid is: oxwaqztrr03rkig3axhosnk4; log out(without closing the browser), and login with TestId2, the sessionid is still: oxwaqztrr03rkig3axhosnk4; it means that the sessionid does not change with the user's changes on the premise that the same browser is not closed.

Login with username TestId1, sessionid: oxwaqztrr03rkig3axhosnk4;

Login with username TestId2, sessionid: oxwaqztrr03rkig3axhosnk4;

 

2. Sessionid changes with the browser

First open a website with Internet Explorer, and login with the username TestId1, the sessionid is: oxwaqztrr03rkig3axhosnk4;

On the same computer, use the Firefox browser and the same user to login to the same website, the login username is TestId1, and the sessionid is: e4mcr3mhknlmxaedqkvhojtv;

The sessionid has changed, which means that even though it is the same computer, as long as the browser type(mainly the kernel) is different, the server will assign a unique sessionid to the client. It is worth noting that for browsers with the same kernel(for example, many browsers use the ie kernel), the sessionid may not change, and you can test and verify by yourself.

 

.Net(C#) test sessionid code is as follows:

Response.Write(Session.SessionID.ToString());