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

Modules and Sessions and Events

dt
I'm trying to create a drop-in dll that will run as a module on an
existing application with just one web.config change. However, it is
necessary to maintain state within the module. I don't think that I'm
using the events correctly.

Can I only manipulate session between AcquireState and ReleaseState
events? Does that mean in BeginRequest or EndRequest, the session is off
limits? I keep getting "not a reference," and, well, that seems to
corroborate my theory.

Can I RewritePath and intercept status codes elsewhere in the chain,
like PreRequest and PostRequest (hopefully)? Or are there restrictions?
If so, can I roll my own session using BeginRequest and EndRequest?

Is there a better way to handle the desire to RewritePaths based on
session?

Thanks,
-dt
Nov 19 '05 #1
1 1033
Hi dt:

That's right, the Session collection hasn't been associated with the
request until AcquireRequestState.

If you just need to pass information along for the duration of the
request you could use the HttpContext.Items collection. It works just
like the Session, and is available from BeginRequest to EndRequest.
The primary difference is that Items is only available for one
request, then it's gone.

I have some more details here:

The HttpContext Items Collection
http://odetocode.com/Articles/111.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 27 Jun 2005 23:44:33 -0500, dt <dt@example.com> wrote:
I'm trying to create a drop-in dll that will run as a module on an
existing application with just one web.config change. However, it is
necessary to maintain state within the module. I don't think that I'm
using the events correctly.

Can I only manipulate session between AcquireState and ReleaseState
events? Does that mean in BeginRequest or EndRequest, the session is off
limits? I keep getting "not a reference," and, well, that seems to
corroborate my theory.

Can I RewritePath and intercept status codes elsewhere in the chain,
like PreRequest and PostRequest (hopefully)? Or are there restrictions?
If so, can I roll my own session using BeginRequest and EndRequest?

Is there a better way to handle the desire to RewritePaths based on
session?

Thanks,
-dt


Nov 19 '05 #2

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

Similar topics

8
by: Grzegorz Dostatni | last post by:
I had an idea yesterday. (Yes, I know. Sorry). If we don't need to declare variables as having a certain type, why do we need to import modules into the program? Isn't the "import sys" redundant...
10
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into...
2
by: Norton | last post by:
I understand how to create HTTP modules that can be used to add functionality to a website but there are a few things I don't understand. If I create an HTTP Module and I want it to intercept a...
0
by: jsale | last post by:
I am having some problems with an asp.net app connected to a sql database. The problem is that people have said that using session may be a problem if you use shared variables in a module. I do use...
9
by: AndersBj | last post by:
Hi all, I have a web application that uses State Server for session handling. The web application randomly loses all session variables. The sessions are not always lost, sometimes I can use the...
5
by: Steve Mauldin | last post by:
Having weird things happening with my code. Two users on at the same time and data entered by one user is added into another users global variable. global variable data being stored in session...
2
by: tbone | last post by:
In trying to improve the throughput of a classic ASP app I wrote last year, I added monitoring to the application and session start and end methods. For one, I'm counting the total number of...
4
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
2
by: Krish........... | last post by:
Hi all, How to find out no of active sessions (at a time) in the web server.. I dont think handling Session_start and Session_end events are useful for this. Is there any way to find all current...
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
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
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...
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.