Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Web Timers

Reply
Thread Tools

Web Timers

 
 
Girish Pal Singh
Guest
Posts: n/a
 
      08-13-2003
I want if a user is browsing the site for some time say 30 minutes
then the current his session should end data should be posted back,
how could i do it.
?
 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      08-13-2003
Girish,

You'll have to do that with client side javascript.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche


"Girish Pal Singh" <> wrote in message
news: om...
> I want if a user is browsing the site for some time say 30 minutes
> then the current his session should end data should be posted back,
> how could i do it.
> ?



 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      08-13-2003
You could create a method that

1. Checks for the existence of a Session "TimeStarted" variable
a. If it doesn't exist, create it and place the Current Time in it
2. Checks the Current Time against the Session variable
3. If the interval of difference is greater than your alloted time, take
some action.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Girish Pal Singh" <> wrote in message
news: om...
> I want if a user is browsing the site for some time say 30 minutes
> then the current his session should end data should be posted back,
> how could i do it.
> ?



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      08-13-2003
Forgot to mention. Of course, the method I described would be placed in
every Page that the user might visit, and execute in the Page_Load method.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Girish Pal Singh" <> wrote in message
news: om...
> I want if a user is browsing the site for some time say 30 minutes
> then the current his session should end data should be posted back,
> how could i do it.
> ?



 
Reply With Quote
 
George Ter-Saakov
Guest
Posts: n/a
 
      08-13-2003
I am not quite sure why would you want to post the data.
The data can be incomplete or user was not going to submit his data at all.

If you just want to prevent his session from an expiration then there is a
simple method.

1. Create transparent.gif image 1x1 pixel.
2. create SessionRefresh.aspx page which outputs back to the browser that
image.
3. On the page which might take more than 20 minutes to fill out ( or any
page you want )
put following code somewhere.

<img src="transparent.gif" width=1 height=1 name="sessionrefresh">
<script>
window.setInterval("document.images['sessionrefresh'].src=sessionrefresh.asp
x;", 10*1000*60 );
</script>

So basically JavaScript will request every 10 minutes the
sessionrefresh.aspx and thus preventing session from expiration.

Also note that cashing might be a problem but you can always add ?param=time
in javascript to the end of sessionrefreshh.aspx. To prevent cashing.


George.

"Girish Pal Singh" <> wrote in message
news: om...
> I want if a user is browsing the site for some time say 30 minutes
> then the current his session should end data should be posted back,
> how could i do it.
> ?



 
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
Timers spf R Siffredi Cisco 1 10-31-2005 05:11 PM
.NET Timers aborting in web application Jeff Greenland ASP .Net 3 12-18-2003 08:12 PM
timers Girish Pal Singh ASP .Net 2 08-11-2003 01:00 PM
System.Timers.Timer vs. System.Threading.Timer Kelsang Wangchuk ASP .Net 0 07-31-2003 04:28 PM
Timers in application web programming Stephen Inkpen ASP .Net 1 07-16-2003 02:12 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57