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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session variables

Status
Not open for further replies.

huobaji

Technical User
Sep 20, 2010
23
US
I have a session variable. it works on some pages but not all them

I have my first page setup this way for my session variable

Session("user") = request.form("user") I go to the next page by using form action

On the second pages I have this:
this works fine
Dim testing
testing = Session("user")
response.write testing

However on this page I have a link that points to another page.


this link works but does not pass the session variable so I get a server error

Response.Write"<tr align=left><td><a href=""" & "XML_CHECK.asp?fname=" & item.Name & _
""" target=""mainFrame"">" & url & " </td><td>" & url3 & " </td><td>" & url2 & _
" </td> <td>" & date3 & " </a> </td></tr>"
 
Your code does not show how you are trying to "pass" that variable, neither how you are trying to query it in said target page.

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
My thinking. Once you setup a session variable. then it can be access to any page in your application. So with that thinking. This is my link that goes to another page

Response.Write"<tr align=left><td><a href=""" & "XML_CHECK.asp?fname=" & item.Name & _
""" target=""mainFrame"">" & url & " </td><td>" & url3 & " </td><td>" & url2 & " </td> <td>" & date3 & " </a> </td></tr>"

once I go there since I already setup my session variable I should be able to access it from here but I cannot




 
Are you sure the session variable is being set in the first place? Maybe request.form("user") is returning a blank string on the first page?
 
My thinking. Once you setup a session variable. then it can be access to any page in your application. So with that thinking. This is my link that goes to another page

That depends on the session.timeout settings, also if the link goes to a folder that is set as a Virtual Directory a new application will be started which will have a different session ID



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Instead of the link, post the portion of that other page where you are trying to access the session variable.
As my colleagues mentioned: it should work.
Your concatenated link does not provide any useful information.

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top