save settings on browser close

Discussion in 'ASP General' started by Jaco Bregman, Dec 8, 2003.

  1. Jaco Bregman

    Jaco Bregman Guest

    Hi all,

    I've been trying to save some user settings when the
    browser closes, but with little success. What I want to do
    is count a users' resource usage, and write it to a
    database when the user closes the browser. I tried to use
    the 'Session_End' event handler in global.asax, but that
    doesn't seem to work.

    Any Ideas?
     
    Jaco Bregman, Dec 8, 2003
    #1
    1. Advertising

  2. Jaco Bregman

    CJM Guest

    Session_OnEnd is very unreliable.

    I would also forget about trying to pin down when a user entered the system
    and when a user left the system, as you might have done with a traditional
    client-server application.

    It is much more practical to record what pages a user calls, and when...
    You can determine that user left within 20 mins of the last page request
    (assuming you leave the default timeout).

    What do you mean by resource usage?

    Time on the system, I assume?

    Chris


    "Jaco Bregman" <> wrote in message
    news:054a01c3bd6d$0387c420$...
    > Hi all,
    >
    > I've been trying to save some user settings when the
    > browser closes, but with little success. What I want to do
    > is count a users' resource usage, and write it to a
    > database when the user closes the browser. I tried to use
    > the 'Session_End' event handler in global.asax, but that
    > doesn't seem to work.
    >
    > Any Ideas?
     
    CJM, Dec 8, 2003
    #2
    1. Advertising

  3. Jaco Bregman

    Jaco Bregman Guest

    Our website uses a third party Internet service for which
    we have to pay. In order to bill our customers for usage
    of this service, we count the number of times this service
    is used, and store this in a Session object. When the
    browser closes, we want to write the usage count to our
    database.

    If the user leaves our website, can I still retrieve the
    information from the session object?

    Jaco

    >-----Original Message-----
    >Session_OnEnd is very unreliable.
    >
    >I would also forget about trying to pin down when a user

    entered the system
    >and when a user left the system, as you might have done

    with a traditional
    >client-server application.
    >
    >It is much more practical to record what pages a user

    calls, and when...
    >You can determine that user left within 20 mins of the

    last page request
    >(assuming you leave the default timeout).
    >
    >What do you mean by resource usage?
    >
    >Time on the system, I assume?
    >
    >Chris
    >
    >
    >"Jaco Bregman" <>

    wrote in message
    >news:054a01c3bd6d$0387c420$...
    >> Hi all,
    >>
    >> I've been trying to save some user settings when the
    >> browser closes, but with little success. What I want to

    do
    >> is count a users' resource usage, and write it to a
    >> database when the user closes the browser. I tried to

    use
    >> the 'Session_End' event handler in global.asax, but that
    >> doesn't seem to work.
    >>
    >> Any Ideas?

    >
    >
    >.
    >
     
    Jaco Bregman, Dec 9, 2003
    #3
  4. Yes.
    use the Seeion_onEnd event.


    --
    Roji. P. Thomas
    SQL Server Programmer
    --------------------------------------
    "Jaco Bregman" <> wrote in message
    news:0a2601c3be41$d3219150$...
    > Our website uses a third party Internet service for which
    > we have to pay. In order to bill our customers for usage
    > of this service, we count the number of times this service
    > is used, and store this in a Session object. When the
    > browser closes, we want to write the usage count to our
    > database.
    >
    > If the user leaves our website, can I still retrieve the
    > information from the session object?
    >
    > Jaco
    >
    > >-----Original Message-----
    > >Session_OnEnd is very unreliable.
    > >
    > >I would also forget about trying to pin down when a user

    > entered the system
    > >and when a user left the system, as you might have done

    > with a traditional
    > >client-server application.
    > >
    > >It is much more practical to record what pages a user

    > calls, and when...
    > >You can determine that user left within 20 mins of the

    > last page request
    > >(assuming you leave the default timeout).
    > >
    > >What do you mean by resource usage?
    > >
    > >Time on the system, I assume?
    > >
    > >Chris
    > >
    > >
    > >"Jaco Bregman" <>

    > wrote in message
    > >news:054a01c3bd6d$0387c420$...
    > >> Hi all,
    > >>
    > >> I've been trying to save some user settings when the
    > >> browser closes, but with little success. What I want to

    > do
    > >> is count a users' resource usage, and write it to a
    > >> database when the user closes the browser. I tried to

    > use
    > >> the 'Session_End' event handler in global.asax, but that
    > >> doesn't seem to work.
    > >>
    > >> Any Ideas?

    > >
    > >
    > >.
    > >
     
    Roji. P. Thomas, Dec 9, 2003
    #4
  5. Jaco Bregman

    CJM Guest

    No. don't use the Session_OnEnd event.

    Each time the user access the service, increment the usage count IN THE
    DATABASE.

    What happens if their machine crashes? What happens if your server crashes?
    What do you do if one of the other 101 events that stop your Session_OnEnd
    code from running occurs? It will be as if your user has not used the
    service at all... in which case, you pay the bills!

    Log each use of the service, directly to the DB, immediately before or
    immediately after using the service.. (you chose which)

    hth

    CHris
     
    CJM, Dec 9, 2003
    #5
  6. hi CJM,
    WHY don´t you use trigger on sql server?
    take a look at sql server help!
    the trigger always starts running when update or delete or insert are
    detected in a table.
    may be your solution.

    REGARDS,
    Vilmar
    Brazil
    "CJM" <> escreveu na mensagem
    news:...
    > No. don't use the Session_OnEnd event.
    >
    > Each time the user access the service, increment the usage count IN THE
    > DATABASE.
    >
    > What happens if their machine crashes? What happens if your server

    crashes?
    > What do you do if one of the other 101 events that stop your Session_OnEnd
    > code from running occurs? It will be as if your user has not used the
    > service at all... in which case, you pay the bills!
    >
    > Log each use of the service, directly to the DB, immediately before or
    > immediately after using the service.. (you chose which)
    >
    > hth
    >
    > CHris
    >
    >
     
    news.microsoft.com, Dec 9, 2003
    #6
  7. Jaco Bregman

    CJM Guest

    Hi Vilmar,

    First of all the OP might not have access to SQL Server.

    Second, I don't see how triggers help in this situation.

    Chris

    "news.microsoft.com" <> wrote in message
    news:...
    > hi CJM,
    > WHY don´t you use trigger on sql server?
    > take a look at sql server help!
    > the trigger always starts running when update or delete or insert are
    > detected in a table.
    > may be your solution.
    >
    > REGARDS,
    > Vilmar
    > Brazil
     
    CJM, Dec 9, 2003
    #7
    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. Denon
    Replies:
    1
    Views:
    582
    Saravana [MVP]
    Nov 14, 2003
  2. Siegfried Heintze
    Replies:
    0
    Views:
    2,281
    Siegfried Heintze
    Oct 24, 2005
  3. donet programmer
    Replies:
    3
    Views:
    1,554
    Gregory A. Beamer
    Nov 20, 2009
  4. Iñaki Baz Castillo
    Replies:
    7
    Views:
    874
    Iñaki Baz Castillo
    Jan 12, 2010
  5. Replies:
    0
    Views:
    503
Loading...

Share This Page