Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
E

eolss

@eolss
About
Posts
2
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • UserConcurrency
    E eolss

    How can I count the number of online users on my site? I have implemented my application as follows. Whenever a user logs in, I increment the count field in my database by 1 in Session_Begin and on Session_End I decrement it by 1.Though the code works fine in normal circumstances, I noticed a few anamolies: 1. If the user refreshes his browser, the Session_Begin is called again and the counter is incremented again. To overcome this, I used cookies. The first time the user logs in, I create the cookie. When the user refreshes his browser, it checks if the cookie exists, if it doesnt it treats it as a new request and updates the counter accordingly. 2. The problem arises on log out. Whenever the user refreshes his browser, Session_End is called that many times, and my counter is decremented more than once. How can I get Session_End to run only once for each instance of the browser? 3. I'm using Forms Authentication and on Session_End I want to call FormsAuthentication.SignOut since the user can still access the pages after the session ends,causing a new session to be started. But this function does not work in Session_End.

    Web Development question database security help

  • Concurrency Metering
    E eolss

    How can I keep track of the number of online users to implement concurrency metering? So far I have implemented as follows: When a user logs in, I add an entry to a Status table in the database and store a cookie in his machine.Every time he refreshes his browser, it checks if the cookie exists.If it doesnt exist, it treats it as a new login and updates the status table. Now I need to remove/decrement the status by 1 when the user logs out. I included this code in Session_End. But there is a problem, I need to call this fucntion only when the user closes his browser. If the user leaves his system idle or refreshes his browser again, Session_End is called twice and the status is decremented by 1 two times, which is incorrect. How should I implement concurrency metering? Is there any other way other than using session, since most users would probably log out by closing the browser instead of clicking the Log Out button.

    Web Development question database help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups