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

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 1997
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******@ameritech.net> wrote in message
news:40****************@news.comcast.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******@ameritech.net> wrote in message
news:40****************@news.comcast.giganews.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.Add(new LiteralControl("<script>window.open('B.aspx',
'"+System.Text.RegularExpressions.Regex.Replace(Da teTime.Now.ToString(),"\\D
","")+"', 'toolbar=no,scrollbars=yes,width=
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******@ameritech.net> wrote in message
news:40****************@news.comcast.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******@ameritech.net> wrote in message
news:40****************@news.comcast.giganews.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.RegularExpressions.Regex.Replace(D ateTime.Now.ToString(),"\\D
","")+"', 'toolbar=no,scrollbars=yes,width=
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******@ameritech.net> wrote in message
news:40****************@news.comcast.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******@ameritech.net> wrote in message
>news:40****************@news.comcast.giganews.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
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
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...
8
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
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...
2
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...
1
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...
11
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...
2
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...
3
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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...

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.