473,395 Members | 1,639 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,395 software developers and data experts.

Testing ASP application sessions

Hello, I have a couple of unclear questions about ASP.NET sessions:

First, I'd like to have some way to see how many sessions currently are
running on the certain application, and, possibly, have some way to peek in
the data of these sessions. If there is no such utility for IIS, perhaps
there is some API that I could use to write a standalone console .NET EXE,
that could talk to IIS (or some other relevant instance) and discover these
data?

Second, I'd like to know, if there is some way to distinguish from different
session expirations. I have a Session_End handler in the codebehind file for
global.asax, and, as by design, it is called whenever the session is about
to be finished, be it call to Session.Abandon, or just automatic session
expiration. So, I'd like to know if there is some way to tell from the
different reasons why session is being ended:
- is it a call to Abandon() method,
- is it an automatic expiration (ie user just closed the application, not
clicked 'log out' button)
- manual application stop
- perhaps code in the bin folder (or web.config file) has changed, forcing
application reload
- any other reason.

Currently I handle the difference by assigning a control value to session
variable prior to calling the Abandon method, and checking for the presence
of this variable in Session_End handler. But, it's sort of hacky way, isn't
it. Also, I see no such workaround way to check for application restart or
code changing situation.

Regards,

Pavils
Nov 18 '05 #1
1 1221
The number of sessions is exposed through performance counters.

By nature session variables are scoped to the parent session. You can't do
that from your app and I don't know if a tool is provided for doing this
(you can if using SQL Server as the session provider). Why do you want to
do that ? You could dump session variables when an error is encoutered.

A sesion doesn't expires when the browser is closed (it expired once the
server has no news from the suer druing a given period of time).

Once again it depends what is the overall goal (for example you can track
application restarts through .NET classes).

Patrice

--

"Pavils Jurjans" <pa****@mailbox.riga.lv> a écrit dans le message de
news:Oo**************@TK2MSFTNGP12.phx.gbl...
Hello, I have a couple of unclear questions about ASP.NET sessions:

First, I'd like to have some way to see how many sessions currently are
running on the certain application, and, possibly, have some way to peek in the data of these sessions. If there is no such utility for IIS, perhaps
there is some API that I could use to write a standalone console .NET EXE,
that could talk to IIS (or some other relevant instance) and discover these data?

Second, I'd like to know, if there is some way to distinguish from different session expirations. I have a Session_End handler in the codebehind file for global.asax, and, as by design, it is called whenever the session is about
to be finished, be it call to Session.Abandon, or just automatic session
expiration. So, I'd like to know if there is some way to tell from the
different reasons why session is being ended:
- is it a call to Abandon() method,
- is it an automatic expiration (ie user just closed the application, not
clicked 'log out' button)
- manual application stop
- perhaps code in the bin folder (or web.config file) has changed, forcing
application reload
- any other reason.

Currently I handle the difference by assigning a control value to session
variable prior to calling the Abandon method, and checking for the presence of this variable in Session_End handler. But, it's sort of hacky way, isn't it. Also, I see no such workaround way to check for application restart or
code changing situation.

Regards,

Pavils

Nov 18 '05 #2

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

Similar topics

33
by: aa | last post by:
I am migrating to PHP from ASP where there are the Application Scope variables which are accessible from any page on a website and which are used, in particular, for hit counters. Is there a similar...
3
by: Grinninger | last post by:
Hello, I am using ASP.NET, C# under W2K. I try to keep some important information in application- and session-state Objects. With the recycling of the ASPNet_WP.EXE my application- and...
5
by: Gaetan | last post by:
I would like to guarantee that only one session at a time can request exclusive access to an object stored in Application. The ownership of the object must last throughout multiple HTTP requests. ...
6
by: Mad Scientist Jr | last post by:
My asp.net pages sessions are timing out after 20 minutes, and when I asked my Web host about it they said due to the nature of a shared hosting environment they cannot allow for sessions to keep...
7
by: zb | last post by:
I am not convinced and need your opinion. My understanding is that if bin directory's content is changed then the ASP.Net application recycles (Applicatin is restarted). Is it also true for the...
0
by: gyung | last post by:
I'm wondering if there is an easy way to test the security of my ASP site. I use a lot of server-side sessions and though I know it can be highjacked, sniffed, and isn't exactly a good use of...
13
by: =?Utf-8?B?YW1pdF9taXRyYQ==?= | last post by:
I Need to forcefully Abandon ASP.NET sessions from an external Windows application or another site. Please help how can i implement this
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.