Create Window width new Session: solution

M

MrZed

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
 
A

Anthony Jones

MrZed said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top