tracking independant hits to page

T

tshad

I have a page that I need to tell how many INDEPENDANT hits have occurred.

I have the following code:

Sub Page_Load(sender as Object, e as EventArgs)
if not IsPostBack then
Call InsertAuditRecord()
end if
End Sub

Which just writes out to a table on who hit this page for a particular
record.

This works fine, but if you do a refresh, it gets counted as another hit
since it isn't a postback. Also, the user can go to another page and then
come back to this page and it is another hit.

Is there a clean way to handle this so that only one hit to the page/record
is recorded once for each visitor?

This is for users that haven't logged on yet, so I don't have any logon
credentials yet.

I was thinking of putting a cookie on their machine to track it, but don't
know if that is the best way.

Thanks,

Tom.
 
S

Steve C. Orr [MVP, MCSD]

Yes, I would think that cookies would be a good informal way of doing this.
It's not 100% bullet proof since people could delete their cookies, but you
may not need it to be 100% bullet proof.
 
T

tshad

Steve C. Orr said:
Yes, I would think that cookies would be a good informal way of doing
this.
It's not 100% bullet proof since people could delete their cookies, but
you may not need it to be 100% bullet proof.

That was what I figured. Probably the best I can do.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top