Attaching a Page to a new Session

K

Keith Patrick

I have an app (A) that has a link to another (B) app that it spawns in a new
window. The new window has a link back to app A, opening a third window
(let's call it A2). The problem is, I need A2 to act like the same user
logged into a clean browser window to app A such that it has a new Session
rather than sharing the same one among the 3 windows. Customer requirement
that it works that way, so I have no other choice but to come up with a way
to programmatically, upon login ensure that the current Session is a new one
and not the shared one. Session.Abandon doesn't work because a new session
is not created automatically, but I can't figure out how to create a new
session in code, as HttpSessionState has no public ctor. *Any* ideas of a
way around this (yes, I know the behavior is by design, but no, I have no
chance of having the requirement changed)
 
K

Kevin Spencer

I think you had better look into some other caching mechanism than Session
for your answer.

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
K

Keith Patrick

Well, what I am attempting to do now is store a hashtable in
Session["User"], with the key being a unique ID generated for each unique
login. The problem I now have is that if window A and its child B are both
in the same app, sharing a session, I can't figure out a way to figure out
which browser window is making a request, so I can't come up with a means of
starting out with some window-dependent piece of unique information.
 
K

Kevin Spencer

Any time you talk about separate browser instances, you're most likely
talking about separate Sessions. Therefore, you can't coordinate between
separate browser instances using Session. However, you can create your own
"Session" state in the Application Cache, by using the Session_OnStart and
Session_OnEnd to add, remove, and/or modify an entry for that user in the
Application Cache. Basically, you need to create a Collection in that Cache
that can be populated with user/browser information for each user logged on.
You could pass the Session ID of the first Session to the
successively-generated pages in a Query String or some other method, and
then have each of these pages link themselves to the "Session" item for that
user in the Application Cache.

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Keith Patrick said:
Well, what I am attempting to do now is store a hashtable in
Session["User"], with the key being a unique ID generated for each unique
login. The problem I now have is that if window A and its child B are both
in the same app, sharing a session, I can't figure out a way to figure out
which browser window is making a request, so I can't come up with a means of
starting out with some window-dependent piece of unique information.


Kevin Spencer said:
I think you had better look into some other caching mechanism than Session
for your answer.

--
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

a
new a
way new
one
of
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top