Transaction Log

G

Guest

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......
 
G

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
 
P

Prince Mathew

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
(e-mail address removed)> wrote in message
news:D[email protected]...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top