Transaction Log

Discussion in 'ASP .Net' started by =?Utf-8?B?Y2xvc2UgYnJvd3NlciB3aXRob3V0IExvZ291dA==, Jan 9, 2006.

  1. Hi,

    I need to keep track of the transactions of an asp.net application with the
    help of a translog table. This table keeps all the transactions that happens,
    like Logging in logging out. but
    the problem is that if a user closes the browser without logging off
    properly or the machine has been swithed off directly, i wont be able to
    track whether the user logged out using the translog table, coz the entry in
    that will remain as he/she is logged in currently...
    also if session timeout occurs i will lose all the contents in the
    Session , so i cant update translog table as i dont have the values....

    Please Send reply on these Probs......
     
    =?Utf-8?B?Y2xvc2UgYnJvd3NlciB3aXRob3V0IExvZ291dA==, Jan 9, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?Y2xvc2UgYnJvd3NlciB3aXRob3V0IExvZ291dA==

    Guest Guest

    There are several ways in which this problem can be resolved. The first
    thing you have to accept is that you're working in a stateless environment.
    You cannot assume that the next request by a user will originate from the
    same IP address or that the user will ever log out. Nor should you assume
    that the Session ID would remain the same during a users session. One thing
    is guaranteed though that if the user looses connection to your site be it
    connection trouble timeout from slow response from your server or there
    computer crashing etc.. They will not brows back to your site (internal or
    external) to log out.

    For this reason you will find most web sites (where logging out is
    essential - i.e. banking sites etc..) are designed around the principle of
    time outs. This is simply defining a time period that if there has been no
    activity on the site for the defined period the user is assumed to have
    logged out. If they try and user the site after this period there asked to
    log back in before being allowed to continue.

    There are a number of ways to resolve this issue quickly and simply. The
    first is by generating a unique ID that you pass from page to page either
    embedded in the html document or as a url query parameter. Each time the
    user logs in you generate a unique ID (most tend to use GUID's for ease of
    generation) store this in the database with the current time. Each time the
    user performs an action on your site query the database using the user's ID
    and the unique ID you generated when they logged in. Check the date time in
    the database against the current time. If this is within the time out period
    update the time field to be now and then process their request. If the time
    out has expired then assume they logged out. If you need a time for the
    logout you can use the last date time entered, although this is not entirely
    accurate for an official logout time it will not be far away from the truth.

    Another simple solution follows the same principals but uses a cookie. The
    problem with this is not everyone likes having cookies enabled, but that
    would fall under part of your design considerations. With cookies you could
    either set the expiry time of the cookie to a time out period. Alternatively
    implement a method similar to the previous example but store the unique id
    in the cookie or implement both.

    Regards

    - Mike

    ---------------------------------------------------------------------------------
    http://www.cogitar.net"> Cogitar Software. ( http://www.cogitar.net )
    http://www.web-dominion.co.uk Web-Dominion. (Web Design and hosting )
    http://www.shop-dominion.com (senery landscape picture gallery)
    ---------------------------------------------------------------------------------

    "close browser without Logout" <close browser without
    > wrote in message
    news:D...
    > Hi,
    >
    > I need to keep track of the transactions of an asp.net application with
    > the
    > help of a translog table. This table keeps all the transactions that
    > happens,
    > like Logging in logging out. but
    > the problem is that if a user closes the browser without logging off
    > properly or the machine has been swithed off directly, i wont be able to
    > track whether the user logged out using the translog table, coz the entry
    > in
    > that will remain as he/she is logged in currently...
    > also if session timeout occurs i will lose all the contents in the
    > Session , so i cant update translog table as i dont have the values....
    >
    > Please Send reply on these Probs......
     
    Guest, Jan 9, 2006
    #2
    1. Advertising

  3. Hi,
    You need to update the translog table in two scenarios

    1. On Browser close()
    use unload() event. This is a client side event. so you can notify
    server in this function
    2. On session time out.
    Use
    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    'DUMP all hte session variables to the translog table

    End Sub

    I havn't tried this, But i am just giving you my thoughts.

    Thanks

    "close browser without Logout" <close browser without
    > wrote in message
    news:D...
    > Hi,
    >
    > I need to keep track of the transactions of an asp.net application with
    > the
    > help of a translog table. This table keeps all the transactions that
    > happens,
    > like Logging in logging out. but
    > the problem is that if a user closes the browser without logging off
    > properly or the machine has been swithed off directly, i wont be able to
    > track whether the user logged out using the translog table, coz the entry
    > in
    > that will remain as he/she is logged in currently...
    > also if session timeout occurs i will lose all the contents in the
    > Session , so i cant update translog table as i dont have the values....
    >
    > Please Send reply on these Probs......
     
    Prince Mathew, Jan 9, 2006
    #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. Henrik_the_boss
    Replies:
    0
    Views:
    2,697
    Henrik_the_boss
    Nov 5, 2003
  2. Amratash
    Replies:
    0
    Views:
    553
    Amratash
    Apr 13, 2004
  3. =?Utf-8?B?VG9tIFdpbmdlcnQ=?=

    My.Log.Writeexception not writing to Application Event Log.

    =?Utf-8?B?VG9tIFdpbmdlcnQ=?=, Jan 20, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,401
    =?Utf-8?B?VG9tIFdpbmdlcnQ=?=
    Jan 20, 2006
  4. unomystEz
    Replies:
    0
    Views:
    578
    unomystEz
    Nov 19, 2006
  5. Vencz Istv?n
    Replies:
    2
    Views:
    304
Loading...

Share This Page