473,614 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

REPLACE SESSION IN CURRENT CONTEXT!

Is it possible to point current context's session to another active
session based on a SessionID?
Nov 18 '05 #1
4 2014
No, that would constitute a security violation. What are you trying to
accomplish? There may be a work around.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Igor" <is******@ameri tech.net> wrote in message
news:40******** ********@news.c omcast.giganews .com...
Is it possible to point current context's session to another active
session based on a SessionID?

Nov 18 '05 #2
Certain versions of EI open new browser windows (popups) in a brand
new process (depending on amount of memory on a machine).

When a new IE window opens in a new process it does not have access to
session cookies (SessionID) and request coming from a pop creates a
new session. I thought that I could use cookies to detect that and
point it back to the right (existing) session. Therefore enabling me
to use the session variable. Otherwise I will probably do away with
using session alltogether and use cookies instead. I am using HTTP
Module to handle my authenication and authorization.

The reason why session cookie gets "lost" in a new windows is because,
it is not persisted cookie and does not expiration date set. If I
could force session cookie to have an expiration (thereby saving it
onto hard drive and making it available for new browser instances0
this would solve my problems too.

I am not interested in client setting changes for solving this
problem.

Thank you very much.

Igor.
On Sun, 11 Jan 2004 12:19:47 -0600, "Alvin Bruney" <vapor at steaming
post office> wrote:
No, that would constitute a security violation. What are you trying to
accomplish? There may be a work around.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Igor" <is******@ameri tech.net> wrote in message
news:40******* *********@news. comcast.giganew s.com...
Is it possible to point current context's session to another active
session based on a SessionID?



Nov 18 '05 #3
> Certain versions of EI open new browser windows (popups) in a brand
new process (depending on amount of memory on a machine). which versions?

I'm using code like this and it works fine.
In A.aspx i'd like to popup a page B.aspx so i do this in A.aspx
[snip]

//write code here to persist your variables and stuff from A.aspx that you
will need in B.aspx
Page.Controls.A dd(new LiteralControl( "<script>window .open('B.aspx',
'"+System.Text. RegularExpressi ons.Regex.Repla ce(DateTime.Now .ToString(),"\\ D
","")+"', 'toolbar=no,scr ollbars=yes,wid th=
950,height=550, resizable=yes') </script>"));

This will work on up level browsers.

For clarification:

Page.Controls.A dd is a handle to the stream. It's a matter of preference.
You could replace it with
Response.Write( "<script>.. ..

The regular expression forces the pop up to be in its own window and not use
existing windows. In B.aspx, I have access to session variables because it
comes from the same application. I think this or a permutation of it would
help you solve your problem.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Igor" <is******@ameri tech.net> wrote in message
news:40******** ********@news.c omcast.giganews .com... Certain versions of EI open new browser windows (popups) in a brand
new process (depending on amount of memory on a machine).

When a new IE window opens in a new process it does not have access to
session cookies (SessionID) and request coming from a pop creates a
new session. I thought that I could use cookies to detect that and
point it back to the right (existing) session. Therefore enabling me
to use the session variable. Otherwise I will probably do away with
using session alltogether and use cookies instead. I am using HTTP
Module to handle my authenication and authorization.

The reason why session cookie gets "lost" in a new windows is because,
it is not persisted cookie and does not expiration date set. If I
could force session cookie to have an expiration (thereby saving it
onto hard drive and making it available for new browser instances0
this would solve my problems too.

I am not interested in client setting changes for solving this
problem.

Thank you very much.

Igor.
On Sun, 11 Jan 2004 12:19:47 -0600, "Alvin Bruney" <vapor at steaming
post office> wrote:
No, that would constitute a security violation. What are you trying to
accomplish? There may be a work around.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Igor" <is******@ameri tech.net> wrote in message
news:40******* *********@news. comcast.giganew s.com...
Is it possible to point current context's session to another active
session based on a SessionID?


Nov 18 '05 #4
I do not think you understand a problem.
There is a known intermittent problem in IE.

Starting with version 5.01 IE had a feature that was designed to
enable people to use PC resources more efficiently when running IE.
IE5.01 would spawn a new thread (if there is only one running) to run
a new window (generated by java pop-up or whatever). Because of that,
the new window opens up in a new process(and there are machine
specific conditions that must be satisfied in order for that to
happen)
because it is a new process/thread it does not have access to Session
Cookies (the ones that die when you close your browser). ASP, my
friend uses Session Cookies to keep track of session (unless you are
using cookieless sessions and I dont want to see that garbage in my
url). New window can mean a lost session cookie and popup sever code
having a different session variable than the page that opened it.

I would like to hear a comment on this sobjecy from someone @
microsoft!!

Cmon Microsoft show us the way out of that one.

I have not found a better option than not to rely on session in
pop-ups.
On Sun, 11 Jan 2004 13:03:06 -0600, "Alvin Bruney" <vapor at steaming
post office> wrote:
Certain versions of EI open new browser windows (popups) in a brand
new process (depending on amount of memory on a machine).

which versions?

I'm using code like this and it works fine.
In A.aspx i'd like to popup a page B.aspx so i do this in A.aspx
[snip]

//write code here to persist your variables and stuff from A.aspx that you
will need in B.aspx
Page.Controls. Add(new LiteralControl( "<script>window .open('B.aspx',
'"+System.Text .RegularExpress ions.Regex.Repl ace(DateTime.No w.ToString(),"\ \D
","")+"', 'toolbar=no,scr ollbars=yes,wid th=
950,height=550 ,resizable=yes' )</script>"));

This will work on up level browsers.

For clarification:

Page.Controls. Add is a handle to the stream. It's a matter of preference.
You could replace it with
Response.Write ("<script>.. ..

The regular expression forces the pop up to be in its own window and not use
existing windows. In B.aspx, I have access to session variables because it
comes from the same application. I think this or a permutation of it would
help you solve your problem.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Igor" <is******@ameri tech.net> wrote in message
news:40******* *********@news. comcast.giganew s.com...
Certain versions of EI open new browser windows (popups) in a brand
new process (depending on amount of memory on a machine).

When a new IE window opens in a new process it does not have access to
session cookies (SessionID) and request coming from a pop creates a
new session. I thought that I could use cookies to detect that and
point it back to the right (existing) session. Therefore enabling me
to use the session variable. Otherwise I will probably do away with
using session alltogether and use cookies instead. I am using HTTP
Module to handle my authenication and authorization.

The reason why session cookie gets "lost" in a new windows is because,
it is not persisted cookie and does not expiration date set. If I
could force session cookie to have an expiration (thereby saving it
onto hard drive and making it available for new browser instances0
this would solve my problems too.

I am not interested in client setting changes for solving this
problem.

Thank you very much.

Igor.
On Sun, 11 Jan 2004 12:19:47 -0600, "Alvin Bruney" <vapor at steaming
post office> wrote:
>No, that would constitute a security violation. What are you trying to
>accomplish? There may be a work around.
>
>--
>Regards,
>Alvin Bruney
>Got tidbits? Get it here...
>http://tinyurl.com/3he3b
>"Igor" <is******@ameri tech.net> wrote in message
>news:40******* *********@news. comcast.giganew s.com...
>> Is it possible to point current context's session to another active
>> session based on a SessionID?
>
>



Nov 18 '05 #5

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

Similar topics

2
1419
by: Kevin Jackson | last post by:
If we are using Library ServicedComponents is it possible to get to the ASP.NET session stuff from a ServicedComponent?
5
2636
by: Filip | last post by:
Hello, (ASP.NET c#) I want to put some common functions into one class and within this class I need to have access to the Session, Request and Response. This class is not page behind file! I keep trying all sorts of namespaces, but to no avail. Keep getting: "The name 'Session' does not exist in the class or namespace 'xyz xyz xyz'" and "The type or namespace name 'Page' could not be found (are you missing a using directive or an...
8
1527
by: Leon | last post by:
I know that I can access session state on an asp.net page using Page objects, but how do I access store data in sessionstate from the middle tiers?
3
1162
by: Rock | last post by:
I have created several forms with procedures that I want to move to a class so it can be used by other forms, but get an error when I move the Session commands; e.g., Session("Mode")="Add" How can I use Session in a class procedure.
2
5545
by: Stu | last post by:
Hi, I am trying to access session variable value from the 'Application_BeginRequest' handler in the global asax file but get the message - 'Session state not available in this context'. I have tried loading the current context using 'Dim context As HttpContext = HttpContext.Current' but get the error 'Object reference not set to an instance of an object' Anyone know how you get at this?
1
4314
by: Aartware | last post by:
I've read all the items about the IHttpHandler and the session-object and I see nothing wrong with my code, but still I have no session object. This is my code: Imports System Imports System.Data Imports System.Web imports System.Web.SessionState Imports System.Web.UI
11
11462
by: Dave | last post by:
I have a site with an App_Code folder that has Global.asax.cs and a file named Upload.cs. I want to pass Upload.cs a Session variable (username) that is set in default.aspx. Setting up a session variable in default.aspx is no problem, but how do I make it available to Upload.cs? I think it's a matter of writting code into the following two files: Global.asax.cs, and obviously, Upload.cs, but how exactly is it done?
2
11984
by: Dave | last post by:
After some digging, I discovered HttpContext.Current.Session is null when trying to access a session variable, username, in my upload.cs code which is in the App_Code folder. I just determined that I can't because HttpContext.Current.Session is null. (HttpContext.Current is fine though) I think there may be another server side method interfering with my ability to access the session.
3
1470
by: Just D | last post by:
Does anybody have any idea why we were able to get Session in Global.asax.cs in .NET 1.1 and the same code became unworkable in .NET 2.0? The code is compilable but the app complains when gets to this point that Session is not available in current context. Why? Just D.
0
8197
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8142
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8589
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8443
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7114
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4136
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2573
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.