473,378 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Sessions never end? IIS 5.1.

I posted this on the MS IIS NG but that NG is slow to respond so I thought
I'd try here to....
I'm using ASP(.NET) trickery to show the number of "current users" on one of
my web sites (http://www.drpt.virginia.gov). I use this method on a few of
my sites but it seems that only this one (on this machine) gives me trouble.
The trouble seems that the sessions simply never end so the code in my Sub
Session_OnEnd is never fired.

As I understand it, sessions will expire after 20 minutes but default if
there is no further activity from the requestor. Yet, my counter never
seems to decrement....only increment. My code is below and I don't think
it's a code (ASP) issue...this is a common trick and this exact code works
fine on other sites. I think it's an issue with this one machine. Can
anyone help or tell me what to check??
Thanks!!

My global.asax file:

'************************************************* ****

Sub Application_OnStart

Application("URLSeed") = "http://www.drpt.virginia.gov/"
Application("CurrentSessions") = 0
Application("TotalSessions") = 0

End Sub

'************************************************* *****

Sub Application_OnEnd

Application("URLSeed") = Nothing

End Sub

'************************************************* ******

Sub Session_OnStart

'============================================
'===== Updating Current Sessions ====================
'============================================
Application.Lock

Application("TotalSessions") = CInt(Application("TotalSessions")) + 1
Application("CurrentSessions") = CInt(Application("CurrentSessions")) + 1

Application.Unlock

End Sub

'************************************************* *******

Sub Session_OnEnd

Application.Lock

Application("CurrentSessions") = CInt(Application("CurrentSessions")) - 1

Application.Unlock

'Killing user's session variables
Session.Abandon()

End Sub
'************************************************* ********


Nov 18 '05 #1
2 1383
I didn't look at your code ... it seems that it maybe an IIS or server
host issue, if the code works on all machines but that one.

First, I recommend that you check server settings and ensure that the
system time/clock is set correctly. Second, check your IIS application
configuration. To do so, in IIS MMC load the properties dialog for the
web site. Under "Home Directory" tab, click the "Configuration..."
button, and click on the "Options" tab in the dialog that pop-ups.
Check the application configuration there and ensure that session state
is set to time out after the desired amount of time.

ib.

D. Shane Fowlkes wrote:
I posted this on the MS IIS NG but that NG is slow to respond so I thought
I'd try here to....
I'm using ASP(.NET) trickery to show the number of "current users" on one of
my web sites (http://www.drpt.virginia.gov). I use this method on a few of
my sites but it seems that only this one (on this machine) gives me trouble.
The trouble seems that the sessions simply never end so the code in my Sub
Session_OnEnd is never fired.

As I understand it, sessions will expire after 20 minutes but default if
there is no further activity from the requestor. Yet, my counter never
seems to decrement....only increment. My code is below and I don't think
it's a code (ASP) issue...this is a common trick and this exact code works
fine on other sites. I think it's an issue with this one machine. Can
anyone help or tell me what to check??
Thanks!!

My global.asax file:

'************************************************* ****

Sub Application_OnStart

Application("URLSeed") = "http://www.drpt.virginia.gov/"
Application("CurrentSessions") = 0
Application("TotalSessions") = 0

End Sub

'************************************************* *****

Sub Application_OnEnd

Application("URLSeed") = Nothing

End Sub

'************************************************* ******

Sub Session_OnStart

'============================================
'===== Updating Current Sessions ====================
'============================================
Application.Lock

Application("TotalSessions") = CInt(Application("TotalSessions")) + 1
Application("CurrentSessions") = CInt(Application("CurrentSessions")) + 1

Application.Unlock

End Sub

'************************************************* *******

Sub Session_OnEnd

Application.Lock

Application("CurrentSessions") = CInt(Application("CurrentSessions")) - 1

Application.Unlock

'Killing user's session variables
Session.Abandon()

End Sub
'************************************************* ********

Nov 18 '05 #2
Thanks for the reply! In fact, the system clock was set to 12 hours ahead
of the real time (pm instead of am). So...how could that effect it? Thanks

"Ireney Berezniak" <ir**************@gmail.com> wrote in message
news:5V7Cc.16132$mm3.1195@clgrps13...
I didn't look at your code ... it seems that it maybe an IIS or server
host issue, if the code works on all machines but that one.

First, I recommend that you check server settings and ensure that the
system time/clock is set correctly. Second, check your IIS application
configuration. To do so, in IIS MMC load the properties dialog for the
web site. Under "Home Directory" tab, click the "Configuration..."
button, and click on the "Options" tab in the dialog that pop-ups.
Check the application configuration there and ensure that session state
is set to time out after the desired amount of time.

ib.

D. Shane Fowlkes wrote:
I posted this on the MS IIS NG but that NG is slow to respond so I thought I'd try here to....
I'm using ASP(.NET) trickery to show the number of "current users" on one of my web sites (http://www.drpt.virginia.gov). I use this method on a few of my sites but it seems that only this one (on this machine) gives me trouble. The trouble seems that the sessions simply never end so the code in my Sub Session_OnEnd is never fired.

As I understand it, sessions will expire after 20 minutes but default if
there is no further activity from the requestor. Yet, my counter never
seems to decrement....only increment. My code is below and I don't think
it's a code (ASP) issue...this is a common trick and this exact code works fine on other sites. I think it's an issue with this one machine. Can
anyone help or tell me what to check??
Thanks!!

My global.asax file:

'************************************************* ****

Sub Application_OnStart

Application("URLSeed") = "http://www.drpt.virginia.gov/"
Application("CurrentSessions") = 0
Application("TotalSessions") = 0

End Sub

'************************************************* *****

Sub Application_OnEnd

Application("URLSeed") = Nothing

End Sub

'************************************************* ******

Sub Session_OnStart

'============================================
'===== Updating Current Sessions ====================
'============================================
Application.Lock

Application("TotalSessions") = CInt(Application("TotalSessions")) + 1
Application("CurrentSessions") = CInt(Application("CurrentSessions")) + 1
Application.Unlock

End Sub

'************************************************* *******

Sub Session_OnEnd

Application.Lock

Application("CurrentSessions") = CInt(Application("CurrentSessions")) - 1
Application.Unlock

'Killing user's session variables
Session.Abandon()

End Sub
'************************************************* ********

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: The Plankmeister | last post by:
Hi... I'm trying my hardest to understand fully how sessions work and how best to use them. However, all I can find is information that doesn't tell me anything other than that sessions store...
13
by: jing_li | last post by:
Hi, you all, I am a newbee for php and I need your help. One of my coworker and I are both developing a webpage for our project using php. We have a copy of the same files in different location...
3
by: Maxime Ducharme | last post by:
Hi group We have a problem with sessions in one of our sites. Sessions are used to store login info & some other infos (no objects are stored in sessions). We are using Windows 2000 Server...
3
by: Will Woodhull | last post by:
Hi, I'm new here-- I've been reading the group for a couple of days. Nice group; I like the way n00b33 questions are handled. I've been using a Javascript routine in index.html to determine a...
2
by: Steve Franks | last post by:
According to the docs you tell ASP.NET to use cookieless sessions by setting a value in the config.web file. However, what if I wanted to determine at run time whether or not I wanted to use...
12
by: D. Shane Fowlkes | last post by:
This is a repost (pasted below). Since my original post, I've double checked the system clock and set all IIS Session Timeout values to 10 minutes. Still ...the problem occurs. I've also...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
22
by: magic_hat60622 | last post by:
Hi all. I've got an app that dumps a user id into a session after successful login. the login page is http://www.mydomain.com/login.php. If the user visits pages on my site without the www (i.e.,...
13
Frinavale
by: Frinavale | last post by:
One of the most fundamental topics in web design is understanding how to pass information collected on one web page to another web page. There are many different ways you could do this: Cookies,...
3
Atli
by: Atli | last post by:
Introduction: Sessions are one of the simplest and more powerful tools in a web developers arsenal. This tool is invaluable in dynamic web page development and it is one of those things every...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.