Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session

Status
Not open for further replies.

Lambro

Programmer
Aug 22, 2001
258
US
On a hosted web server I have asp pages that when I login it stores a session throughout the website until the session is killed. What I am trying to do is keep a session alive while going from one web server to another. So let's say I login on my website and it creates a session. On my website I have a link to another website of mine on a different server. On that server, the page that I'm linking to has the same code at the top of the page as my pages on my first server. When I click the link and I goto the page, the session is killed. Is there a way to keep it alive?

Here's my session code:



<%
if not session("userinfo")="" then
Dim userinfo,prefix
userinfo=split(session("userinfo"),"|")
%>


<%
else
response.redirect ("%>
<%end if%>
 
you could pass the variable in the link.. ie:

Code:
<a href="[URL unfurl="true"]http://www.website.com/index.asp?var=<%=Session("varname")%>">some[/URL] link</a>

Then you would store that variable into the session state of the other server.

Code:
<%
Session("varname") = request("var")
%>

Cheers,

G.

Xedia Media Solutions
-----------------------------
Components/Tools/Forums/Software/Web Services
 
This is my objective. On a server at one of my companies, I have a login page running on the webserver their. I have my website host on a server in another building. On that website, I have people that login to their profile and they have a link to get to the other server to login. That login page, I don't want people to be able to bookmark it and bypass my website where their profile is. I want them to have to login on my website to their profile and then click a link to get to the login page. Any ideas?
 
In that case.. you can do something like this.. it's not the "prettiest" way of doing but.. if you need something accomplished, you got to get down and dirty right?

Try this:

Code:
<form action="[URL unfurl="true"]http://www.website.com/index.asp"[/URL] method="post">
<input type=hidden name="userinfo" value="<%=Session("UserInfo")">
</form>
<a href="javascript: document.forms[0].submit();">Other Site</a>

On the other server.. get the variable like so:

Code:
<%
Session("UserInfo") = request.form("UserInfo")
%>

This will prevent people from bookmarking the link.. Since it is a web form that has to be submitted to get the information across, it therefor cannot be bookmarked.

Hope that helps,

G.




Xedia Media Solutions
-----------------------------
Components/Tools/Forums/Software/Web Services
 
Correct me if I'm wrong, but isn't it impossible to submit a page to a different page on another server? That being the case, wouldn't it be impossible to use Request.Form?

-kaht

banghead.gif
 
you can post a form to anywhere accessible... get or post.

lambro, i'll give this some thought, hopefully post here a little later for you.

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top