Single page judges whether the browser accepts cookies

zhaozj2021-02-16  41

In ASP applications, the session objects are often used to save user temporary private data, while ASP's session objects are dependent on the browser cookie. If the user is not intended to turn off the cookie option in unintentional, the ASP will not be correct. Identify the user, eventually leading to the session object. To properly implement the program, you must first recognize whether the client accepts cookies, but the browser does not provide the method that identifies the Cookie is off, so we need to find a way to test. So many developers have used their own way to test the browser cookie status, the most common method is to send a cookie in a page, then test whether this cookie exists in another page. In this way, we need two ASP requests. What I introduced here is a method of incorporating server scripts and client scripts and testing a browser status. When NetBox first initializes the ASP program, a new session object will be assigned and a cookie named by application.ApplicationId is sent to the client. If you accept cookie, the browser will return this cookie, NetBox After receiving this cookie, the server will use the SESSION object it specifies as the SESSION object of this ASP request to ensure that the session object is for specific users uniqueness and persistence. Thus we know, it is possible to determine whether the following programs can be proceed by judging whether the browser accepted the cookie name of Application.ApplicationID. To determine if there is a cookie in the browser, it is done using the browser's cookie object. The following code is whether the test browser accepts NetBox session: