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

Attaching a Page to a new Session

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)
Nov 18 '05 #1
3 1309
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.

"Keith Patrick" <ri*******************@hotmail.com> wrote in message
news:#l**************@TK2MSFTNGP12.phx.gbl...
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)

Nov 18 '05 #2
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" <ke***@takempis.com> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
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.

"Keith Patrick" <ri*******************@hotmail.com> wrote in message
news:#l**************@TK2MSFTNGP12.phx.gbl...
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)


Nov 18 '05 #3
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" <ri*******************@hotmail.com> wrote in message
news:eX*************@TK2MSFTNGP11.phx.gbl...
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" <ke***@takempis.com> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
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.

"Keith Patrick" <ri*******************@hotmail.com> wrote in message
news:#l**************@TK2MSFTNGP12.phx.gbl...
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)



Nov 18 '05 #4

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

Similar topics

1
by: Jim Heavey | last post by:
Hello, I was wondering how I would go about attaching some Java script code to a <asp:EditCommandColumn. If the user presses the "edit" link, then I want to test other controls to see if any...
5
by: Mike Logan | last post by:
We are creating an HTTP Module to add code to the Application On Start of an applicaton. However, there is no HTTPApplication.OnStart event to attach to. Does anyone know how to attach to this...
2
by: john.lehmann | last post by:
Attacked is a piece of code which first hits the login page successfully and receives back login cookies. But then when I attempt to hit a page which is restricted to logged in users only, I fail....
0
by: john.lehmann | last post by:
Attacked is a piece of code which first hits the login page successfully and receives back login cookies. But then when I attempt to hit a page which is restricted to logged in users only, I fail....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.