No Global.asa and Session to implement online number statistics

zhaozj2021-02-16  71

The most common method of realizing online number statistics is Golobal.asa combined with session, but this approach has two adverse:

1. Each session is to take up 12K server memory space, and pay 12K memory for the number of people 1.

2, Golobal.asa will work in the root of the website, and the root directory can only have a golobal, contradictory.

To this end, there is a way to use cookie and Application in the ASP file to realize online statistics. Welcome to the criticism, joint discussion:

Step 1: Do a framework, including hidden framework (Count.asp)

Step 2: Write Count.asp <% User = Request.Cookies ("21bbsuserName") Totaluser = Application ("User") IF INSTR (Totaluser, User) = 0 ThenApplication.lockApplication ("User") = TotalUser & ";" & useerapplication.unlockend IF%>

Step 3: Display User = Split (Application (";"), ";" Num = Ubound (user) response.write Num

转载请注明原文地址:https://www.9cbs.com/read-15181.html

New Post(0)