Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Transaction Log

Reply
Thread Tools

Transaction Log

 
 
=?Utf-8?B?Y2xvc2UgYnJvd3NlciB3aXRob3V0IExvZ291dA==?=
Guest
Posts: n/a
 
      01-09-2006
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......
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      01-09-2006
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
http://www.velocityreviews.com/forums/(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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......



 
Reply With Quote
 
 
 
 
Prince Mathew
Guest
Posts: n/a
 
      01-09-2006
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 Removed)> wrote in message
news(E-Mail Removed)...
> 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......



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My.Log.Writeexception not writing to Application Event Log. =?Utf-8?B?VG9tIFdpbmdlcnQ=?= ASP .Net 0 01-20-2006 06:41 PM
Win2003 SP1 error: "New transaction cannot enlist in the specified transaction coordinator" Vencz Istv?n ASP General 2 05-02-2005 05:53 AM
Log On Screen Changed. No More Auto-Log On. Jerry G. Computer Support 2 10-22-2004 09:58 AM
Urgent Pls: Facing problem in reading Log information from Log file, created by IIS Amratash ASP .Net 0 04-13-2004 09:08 AM
Need help on the Permissions needed to log to Event Log from ASP.NET? Henrik_the_boss ASP .Net 0 11-05-2003 10:14 AM



Advertisments