469,923 Members | 1,828 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

save settings on browser close

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?
Jul 19 '05 #1
6 3452
CJM
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" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
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?

Jul 19 '05 #2
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 systemand when a user left the system, as you might have done with a traditionalclient-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" <an*******@discussions.microsoft.com> wrote in messagenews:05****************************@phx.gbl...
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?

.

Jul 19 '05 #3
Yes.
use the Seeion_onEnd event.
--
Roji. P. Thomas
SQL Server Programmer
--------------------------------------
"Jaco Bregman" <an*******@discussions.microsoft.com> wrote in message
news:0a****************************@phx.gbl...
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" <an*******@discussions.microsoft.com>

wrote in message
news:05****************************@phx.gbl...
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?

.

Jul 19 '05 #4
CJM
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
Jul 19 '05 #5
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" <cj*****@yahoo.co.uk> escreveu na mensagem
news:Oi**************@TK2MSFTNGP10.phx.gbl...
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

Jul 19 '05 #6
CJM
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" <su*****@hitecnet.com.br> wrote in message
news:eR**************@tk2msftngp13.phx.gbl...
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

Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Marco Krechting | last post: by
7 posts views Thread by Javaman59 | last post: by
3 posts views Thread by Jaco Bregman | last post: by
2 posts views Thread by John | last post: by
reply views Thread by Rob | last post: by
12 posts views Thread by =?Utf-8?B?RnJlZU5FYXN5?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.