Achieve online demographics without Golobal.asa and session

Source: Internet
Author: User
Tags count root directory server memory
session| Statistics | online | Online numbers the most common way to achieve online demographics is Golobal.asa combined session, but this approach has two disadvantages:
1, each session to occupy 12k of server memory space, for the number of +1 will pay 12k memory costs.
2, Golobal.asa to put in the root directory of the site will play a role, and the root directory can only have a golobal, contradictions outstanding.
To this end, there is a use of cookies and application in the ASP file to achieve online statistics method, welcomed the criticism, common discussion:

Step one: Make a framework that contains hidden frames (count.asp)

Step Two: Write count.asp
<%
User=request.cookies ("21bbsusername")
Totaluser=application ("User")
If InStr (Totaluser,user) =0 Then
Application.Lock
Application ("user") =totaluser& ";" &user
Application.UnLock
End If
%>
<meta http-equiv= "Refresh" content= "2" >
<body>
</body>

Step three: Show
User=split (Application ("User"), ";")
Num=ubound (user)
Response.Write Num



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.