|
From: MrZed on 12 May 2008 08:56 I run into this problem, and I read many places that these is not solvable. I have one solution (workaround), not simple, a little trickier, limited, but possible and usable. My main problem was, that I have a complex site, and I have to make an archive site. Part of database is moved to the archive database (same structure), and the web should be the same (different users and rights stored in 2nd db) ... and I have to open it from the main site so, that both sides work simultaneously with different sessions ... Solution: In the IIS you have to make Virtual Directories as application (example: test and test1, and because I am lazy, they local path is the same directory, they use the same files) Normally you call the site by the server/test address (so here http://server/test/test.asp) In the test asp if you click to open a new window ( javascript:window.open(...) ), you use the other IIS Virtual Directory, so there you open it as http://server/test1/test.asp And so in the new window you have the same test.asp running, but width a different session and sessionID Test.asp is simple (called as http://server/test/test.asp ): <html> <head> <title>NewID test</title> </head> <body> <table><tr> <td>SessionID: <%=Session.SessionID%></td> </tr></table> <input type="button" onClick="newwindow()" value="new window"> <script language="javascript"> function newwindow() { window.open('/test1/test.asp','','toolbar=no'); </script> </body> </html> It is limited, because for every new session a new Virtual Directory is needed (like a working thread, but I only need +1 ) if someone has an easier solution, don't hesitate to share ;) Zed
From: Anthony Jones on 13 May 2008 05:08 "MrZed" <mrzed001(a)gmail.com> wrote in message news:7d55c986-d2ce-4007-a479-230dab3366ec(a)i76g2000hsf.googlegroups.com... > > I run into this problem, and I read many places that these is not > solvable. > > I have one solution (workaround), not simple, a little trickier, > limited, but possible and usable. > My main problem was, that I have a complex site, and I have to make an > archive site. > Part of database is moved to the archive database (same structure), > and the web should be the same (different users and rights stored in > 2nd db) ... and I have to open it from the main site so, that both > sides work simultaneously with different sessions ... > > Solution: > In the IIS you have to make Virtual Directories as application > (example: test and test1, and because I am lazy, they local path is > the same directory, they use the same files) > Normally you call the site by the server/test address (so here > http://server/test/test.asp) > In the test asp if you click to open a new window > ( javascript:window.open(...) ), you use the other IIS Virtual > Directory, so there you open it as http://server/test1/test.asp > And so in the new window you have the same test.asp running, but width > a different session and sessionID > > Test.asp is simple (called as http://server/test/test.asp ): > <html> > <head> > <title>NewID test</title> > </head> > <body> > <table><tr> > <td>SessionID: <%=Session.SessionID%></td> > </tr></table> > <input type="button" onClick="newwindow()" value="new window"> > > <script language="javascript"> > function newwindow() { > window.open('/test1/test.asp','','toolbar=no'); > </script> > > </body> > </html> > > > It is limited, because for every new session a new Virtual Directory > is needed (like a working thread, but I only need +1 ) > > if someone has an easier solution, don't hesitate to share ;) > Thats sounds like a reasonable solution to your specific problem. I don't seeit as being particularly complex or tricky for your scenario. However its not a solution for the general often requested feature to create a new session in an application from within a webpage. As you've stated there is no solution to that general requirement. -- Anthony Jones - MVP ASP/ASP.NET
|
Pages: 1 Prev: tree menu from current directory Next: Code Snippet Respository |