Here's my scenario, a user logs in to the sharepoint site and visits a document library, then I have this webpart that gets the username of the user and stores it in the database, however, my problem is that whenever the user refreshes the browser(press
F5), another session ID is thrown to the user meaning, my code will again put the username to the database and it will now have 2 data/record in my database.
What I want to do is that whenever a user visits a document library, the username will be stored in the database once, or until he logs out or after a certain amount of time. and if the user refreshes his browser(press F5) it will not count as a view/hit
therefore, the username will not be stored to the database.
I've been trying this with alot of if statements however I cant find a way to handle this. I think i really need your help again.
View Complete Post