Verifying the user is connected

Discussion in 'ASP .Net' started by Robert Scheer, Sep 18, 2005.

  1. Hi.

    My site needs to know if the user is connected before executing some
    queries on my database. Actually, I have a page loaded by an Iframe
    that runs every 30 seconds and updates a field on my database to tells
    me the user is connected. If this field is not updated for more than
    one minute I consider the user disconnected.

    The problem is, if that page does not load for any anormal reason (an
    IIS error like Page Could not be Loaded, for example), my database
    won't be updated, but the user is connected!

    What is the best way to detect a user is connected on your site? I read
    about an element on the Machine.config file called
    clientConnectedCheck. Can it be used for that kind of verification?

    Thanks,
    Robert Scheer
    Robert Scheer, Sep 18, 2005
    #1
    1. Advertising

  2. Robert,

    Technically, after each page is delivered to the client the user is no
    longer connected to your website.

    That is why session state was invented. Session state is simply a timer that
    gets reset every time a user connects to the server. How does the server
    know which user is currently connecting? The first time a "new" user
    connects to the server and begins a new session a cookie is stored on the
    server.

    I would suggest that you use the user session to check if a user is still
    connected and set it for longer than a single connection to your iFrame
    refresh. So if your iFrame refreshes once a minute and you want to give a
    user up to three tries to connect set your session timeout to three minutes
    and twenty seconds or something similar to that logic.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "Robert Scheer" <> wrote in message
    news:...
    > Hi.
    >
    > My site needs to know if the user is connected before executing some
    > queries on my database. Actually, I have a page loaded by an Iframe
    > that runs every 30 seconds and updates a field on my database to tells
    > me the user is connected. If this field is not updated for more than
    > one minute I consider the user disconnected.
    >
    > The problem is, if that page does not load for any anormal reason (an
    > IIS error like Page Could not be Loaded, for example), my database
    > won't be updated, but the user is connected!
    >
    > What is the best way to detect a user is connected on your site? I read
    > about an element on the Machine.config file called
    > clientConnectedCheck. Can it be used for that kind of verification?
    >
    > Thanks,
    > Robert Scheer
    >
    S. Justin Gengo, Sep 18, 2005
    #2
    1. Advertising

  3. Robert Scheer

    Guest

    , Sep 19, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2lsdmlh?=

    User connected in a web

    =?Utf-8?B?U2lsdmlh?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    341
    Hans Kesting
    Oct 4, 2004
  2. Guy
    Replies:
    1
    Views:
    674
    Jonck
    Sep 27, 2004
  3. Mike

    Verifying user's email address

    Mike, Jul 25, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    756
  4. Prabhat

    If User connected to IIS

    Prabhat, Oct 7, 2005, in forum: ASP General
    Replies:
    11
    Views:
    218
    Evertjan.
    Oct 7, 2005
  5. Frances Del Rio

    detecting if a user is connected to the internet...

    Frances Del Rio, Oct 13, 2004, in forum: Javascript
    Replies:
    2
    Views:
    111
Loading...

Share This Page