how to create new session using activex in

DeveloperIIPL used Ask the Experts™
i want to create  a new session when user clicks on the link with "target =_blank".
i came to know this can be done by using activex .
Any expert can can you tell me how to do that .
iam using 3.5 frame work
Iam giving 500 points for this
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AdamSenior Developer

When you say create a news session, I assume you mean you want to end the existing session and create a new one, not have two sessions at the same time?
As far as I know, it is not possible to have two simultaneous sessions from one web application in the same browser, at the same time.

I just tried this, 2 different way.

1) ASP.Net Hyperlink. You can set the target, but there's no post back, so you can't do anything to end the session before you continue
2) LinkButton. You can end the session, but as it's a PostBack, you can't set the target.

Another idea that has just occured to me. On your target="_blank" links, include an onclick="return clearSession()" event handler.

In Client Side JavaScript, set a cookie in the clearSession() method.

Hopefully (I haven't tested it, but it should be the case) this cookie will be posted as part of the request for the new page. Check for that cookie, then use Session.Abandon(); to clear the current session, forcing the creation of a new session. You will also need to delete the cookie, otherwise you'll get a new session every page you request after that.

I can create some example code if you get stuck


Currently iam working like this.
This is not the solution iam looking for.
I want to know it is possible to open a new window with new session and still old session exist in Parent window.
Is this possible using activex.?????
if yes how???
AdamSenior Developer

As you can only have one session per web browser, the only way I could imagine this happening would be for an Active X component which, when called, opened up a new application window on your desktop. This Active X app would contain the Internet Explorer rendering engine, but manage it's own cookies, so it would appear to the server that a new session was required.

This is quite a complex solution though, and not something I'd recommend for a public web site. What are you trying achieve with this? Is there no other way of doing it?
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.


See when user clicks on the link i want new session to be created.
Please let me know how this can be done using activex.
Any code will be appericiated.
Thanks for ur suggestion <b>Mr Cyber-spy
AdamSenior Developer

Why do you want to do this? What are your trying to achieve with your new session


My site is quiz site.
if user clicks the link and played 4-5 questions without minimize the page if he open new browser nad  types the url he is having the same session values of the previous browser.
so i want to have new session wen every time user clicks the link.
Senior Developer
Why does having the same session cause a problem?

If he starts a new quiz, and you are storing the answers or something in the Session, use a naming convention to ensure each quiz's answers are kept separate.

The route you are going down with multiple sessions and ActiveX will probably put off many IE users, and won't work at all on other browsers (which don't support ActiveX)

Also, if the user needs to login to play, then each new session will require him to re-authenticate, further harming the user's experience.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial