473,396 Members | 2,076 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,396 software developers and data experts.

Session provider - ResetItemTimeout called multiple times per page

I have written a custom session state provider that stores session data in
XML in a SQL database [don't ask why], and I was running the SQL profiler to
verify that all of my stored procedures were called in the correct
situations. Each time I visited certain pages, I noticed that the SP called
by the ResetItemTimeout method was called multiple times in a row.

I have tracked this problem down to the point of the WebResource.axd module.
It appears that the number of calls to ResetItemTimeout is equal to the
number of times a resource from WebResource.axd is referenced within my page,
such as for scripts and images. This specifically happens on pages where I
am using the TreeView control or the Login control.

Since there's no reason to have these extra hits on the database every time
a resource is referenced by a control, I'm considering updating my session
provider to simply skip the database call in ResetItemTimeout if
Context.CurrentHandler is of the "System.Web.Handlers.AssemblyResourceLoader"
type. However, I hate to hard-code something like that in. But after
looking at the code for the SessionStateModule class in Reflector, I can't
find any way other way to turn these unnecessary calls off.

Am I doing something wrong or is this just a problem with the way .NET 2.0
uses the AssemblyResourceLoader HTTP handler? It seems pretty excessive for
it to be updating the expiration value that many extra times when it should
already be updated when the main page is processed and it calls the GetItem
method.

I tested this using the default ASP.NET SQL Server sesssion state provider
and see the same type of results. The dbo.TempResetTimeout procedure is
called multiple times.

Jan 24 '06 #1
0 1561

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

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
5
by: Phil Grimpo | last post by:
I have a very odd situation here. I have an administration page, where based on a users permissions, a recordset is called from the SQL server which has a list of paths to "Module Menus". Each of...
14
by: mjkahn | last post by:
I've read (and read!) that you shouldn't store objects in Session variables. I've read these reasons: - The object takes up memory that may not be freed until the session times out. Better to...
5
by: ASP.Confused | last post by:
As you can tell from my previous posts on this issue...I'm really confused :-/ I have a few ASP.NET web applications on my web host's "https" server. Our web host has a single "bin" folder for...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
10
by: Li Pang | last post by:
Hi, I created a html page from which I give a link to another web site. The new site is opened in a new window. When I opened multiple windows, they all have the same SessionID. I want ot know...
6
by: Tarun Mistry | last post by:
Hi everyone, thought my current testing, it seems a new session is opened for a user per browser window. I would like my sessions to track based on the machine, i.e. once per machine. What...
1
by: RahulBose | last post by:
Hi, I am getting the exception "Unable to connect to SQL Server session database." many a times in my web app. I am dotNet 2 and Sql Server 2005. (1) I use StateServer, and everything is working...
25
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
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?
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.