|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
Session Variables not kept through form submit to load asp page.
ok.. here's what i have:
1. A portal that loads an asp page into a frame called "main" 2. The Macromedia flash button used to link to this asp page has for elements equivelant to the following <form name="link" action="login.asp"> <input type="hidden" name="Master_Affiliate" value="532"> <input type="submit" value="submit"> </form> 3. I know that the variable works, because when i use the following code: ---------------------------------------------------------------------------------- if (isempty(Request.Form("Master_Affiliate"))) then Session("Message") = "Data Missing." else Session("Master_Affiliate") = Request.Form("Master_Affiliate") end if Response.Write("MA=" & Session("Master_Affiliate") & ".<br>") ---------------------------------------------------------------------------------- Displays the following on login.asp page when it loads: ---------------------------------------------------------------------------------- MA=532 ---------------------------------------------------------------------------------- 4. The problem now is that when I load another ASP page (data.asp) the session variable Master_Affiliate gets lost. This is the code I am using to try and track it: Response.Write("MA=- " & Session("Master_Affiliate")) if ( isempty(Session("Master_Affiliate")) ) then Session("Message") = "Data Missing." Response.Redirect("login.asp") end if this results in a redirection to the login page every time before i can even see that the variable is lost. 5. The ASP pages are loaded into the same frame.. and reside int he same directory on the web server.... what could cause the variable to just dissapear like that? there are no other references in the script that set the session variable, only ones that read it. I keep getting the "Data Missing" error message which means that I have been redirected to the login.asp because the session variable is missing.
__________________
Thanks, Silver Tiger |
|
#2
|
|||
|
|||
|
the only thing I can think of is
Review your code and make sure you are not overwriting the session variable. I personally did that a couple of times. So, that is the reason. I am saying, may be you have to very closely look at the code. Remove the redirect first and try to debug when is the value changing at different points of the page, by introducing response.end and display the value of the session (variable) |
|
#3
|
||||
|
||||
|
well... stupid me.. it worked on my machine.. and not another.. had to tell the other guys to allow cookies (hence the loss of variables... no cookis = no session.. lol)..
thanks. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Session Variables not kept through form submit to load asp page. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|