How to open new window with new session?

In my web application I need to open another (browser) window with a new
session in such a way that it does not close the sesstion in the opening

The scenario is as follows: Administrator changes some user profiles and
need to check the changes. I provided a link to open the new window, but as
soon as I login as another user in the new window - the old window loses
administrative profile.

Any help?

If you need to do this for testing, the trick is to use a different browser. For example, if you are working in Internet Explorer, open up Firefox.

As for doing this outside lab situations, it is very, very difficult as the session is tagged with a cookie which will be shared by all concurrent instances of your web browser.

Thanks WW_B i want to do it Practically. can you give me some links or suggestions that how can I do this. bcz it is my sole requirment now

This is a case where you will need to either do some serious rejiggering of the system or the requirement.

The issue is that sessions are made to work by creating a temporary session ID cookie. This cookie remains in memory so long as any instance of that browser session is open. You cannot just temporarily make a new session. The administrator will have to destroy the session and login as the user.

This is something I am interested in too and I was wondering if the following link provides the solution?

Could this be the answer? I have .Net 1.1 and in my simple test it appears to work when a second window of the browser (IE) was opened by using File/New or Ctrl/N.

I found this on Google:

Request.Cookies(“ASP.NET_SessionId”).Expires = Now

Here’s the link:"session+id"&rnum=5#ccd4e125858ff9a7

Weirdest thing I’ve ever heard: That the world was created by an invisible guy who loves me but will torture me for all eternity if I do not believe in him.

Well, I tried File/New and Ctrl-N a second and third time to open a 3rd and 4th instance and it repeats the 2nd instance.

Anyone else have any other clues?

Weirdest thing I’ve ever heard: That the world was created by an invisible guy who loves me but will torture me for all eternity if I do not believe in him.

Could it work every time if the string “ASP.NET_SessionId” was replaced with something that was generated randomly?

Weirdest thing I’ve ever heard: That the world was created by an invisible guy who loves me but will torture me for all eternity if I do not believe in him.

You say your administrator privilages are lost when you login as the user to test the settings, could this not be because your login uses the same session for users? Could it not be possible to set an Admin session and a User session?



That is what i need. I want admin session maintained and new user session Should be created.


Session["Admin"] = Session["User"];
Session["User"] = new User("gRoberts", 1); // User object, can be anything you like.

When your finished

Session["User"] = Session["Admin"];
Session["Admin"] = null;

Thats the simple way if you were to use a modal window, but if your just using a new window (javascript then you’d have to maintain the session on both pages, but one for a different user.

Or you could create a clone session, meaning Session[“Clone”], which if null your script will read from the normal user session otherwise it would read from this.

The company I work for, we have an online management system for Data Storage (the business I work in) which sometimes can become very funny with certain users, so we created a clone user section that allowed us to select the user and login as if we were them, this was simply done by creating a clone session.

We then setup our scripts to look for this clone session, if it was present take the values from that user, otherwise use the user session (as if the user is really logged in)

i’ll try and knock up some code for you.


Just another note, what you can do, is if the user is an admin when they login, set both the admin session and user session to the same data.

When you want to clone a user, on the pages that will be tested, if the two session are not the same (ie you have now populated the user session with the user you want to clone) then automatically read from the user session, whereas in your control panel use the other way round, use the admin session to authenticate the actions you are running.

To be honest, my brains fried and i’m at work, so I can’t really do much of an example without creating everything that goes with it.



If you use cookieless sessions you should be able to use multiple sessions against the same application, as the session identifier sits in the url. A link to a page without the session identifier should create a new session.

Another option is to create to applications (in seperate virtual dirs of IIS), but mapping to the same directory. This should fool IIS into believing that it’s two seperate application, but sharing codebase, configurations and data.

Hi again folks,

Could the following be a valid solution to allowing 2 different Users to be logged on and connected to the application, from the same PC when you open a second window in IE using File/New or Ctrl-N, without interfering with each others’ data?