views:

623

answers:

3

My asp.net application works fine when launched from its own browser, but when its launched from another web application (sharepoint webpart) using window.open it works until the user clicks and posts back, then the session is lost.

I think its related to cookies, because when I set the session state to be cookieless everything works fine.

Why does the sesssionid get lost in the NEW application when launching the app using window.open? I would like each application to have its own session cookie, I've tried setting the name of the cookie but the same thing happens, on the first post back the sessionid is lost??

Please help?

A: 

Sharepoint manages it's own session. Sessions are tied to applications (URI). You would need to share some sort of login token between applications.

check out:

http://forums.asp.net/t/1335229.aspx

http://forums.asp.net/p/1356006/2781938.aspx

Tim Hoolihan
I dont want the sessions to be shared - I want the 2 applications to be seperate and not share cookies, sessions or any authentication. Its almost like the session id cookie is created but somehow linked back to the orignal browser window, so when I post back in the new application (inside the new launched window.open'ed window) its now lost??
A: 

What browser are you using?

IE6 has this exact issue, possibly newer versions as well.

Refer to Microsoft Support

Bryan Migliorisi
I don't want the 2 apps to share any data via cookies or session, I get the same issue on IE7 and IE6.
Is there a better way to launch a new broswer window instead of using window.open. The reason window.open is used is because its generated as part of a post back in the webpart (in sharepoint). E.g. Click button on sharepoint app, it posts back does some stuff, generates some client side javascript to launch the new app (window.open etc) then renders the page, and the javascript executes, new window appears with new app, click button session lost.
A: 

drop window.open(). use links with tarket="blank". if you need to call them from JS just do link.click() on it.

AZ