problems passing Session variables

Results 1 to 2 of 2

Thread: problems passing Session variables

  1. #1
    Join Date
    Dec 1969

    Default problems passing Session variables

    Hello everyone and, again, thanks for your help in the past.<BR>I am trying to set up a "Test Cookies on Your System" on a login page in which when the visitor clicks on the link, a cookie is sent to their system, then they are redirected to another page that determines if cookies are enabled, then they are redirected back to the login page for the answer.<BR><BR> I am having a problem getting the answer back to the login page. I have tried to set local variables for the session variables on all pages, but it still doesn&#039;t seem to work.<BR><BR>This is the code I use on the second Cookie Test page:<BR><BR>sTestID = Request.Cookies("TestID")<BR>If sTestID = "" Then<BR> Session("badCookie") = "T"<BR> Session("CookieError") = Session("CookieError") + 1<BR>End If<BR><BR>If Session("CookieError") &#062; 0 then<BR> response.redirect "index_LOGIN5.asp"<BR>else<BR> response.redirect "index_LOGIN5.asp"<BR>End If<BR><BR>This is the code I am using on my login page in the hopes I can give the viewer the answer to whether Cookies are enabled on their system. I can&#039;t get the answer to come back to the login page:<BR><BR>If Session("CookieError") = 0 Then<BR> vCookies = "&#060;a href=LoginCookiesTest.asp&#062;Click here&#060;/a&#062; to test cookies on your system."<BR>Else<BR> Session("CookieError") = "0"<BR> End If<BR><BR>vTestID = Session("badCookie")<BR><BR>If Session("badCookie") = "T" Then<BR> eCookies = "<BR>&#060;font color=FF0000&#062;Cookies are not enabled in your Web browser. Please click here for instructions.&#060;/font&#062;"<BR>Else<BR> eCookies = "<BR>&#060;font color=0000FF&#062;Cookies are enabled in your Web browser.&#060;/font&#062;"<BR> Session("badCookie") = "F"<BR> End If<BR><BR> Thanks in advance for any input you may be able to give on this. I definitely appreciate it.

  2. #2
    Join Date
    Dec 1969

    Default RE: problems passing Session variables

    Session variables store data as a string, so this is never true...<BR><BR>If Session("CookieError") &#062; 0 then <BR>If Session("CookieError") = 0 then <BR><BR>Should be<BR><BR>If trim("" & Session("CookieError")) &#062; "0" then <BR>If trim("" & Session("CookieError")) = "0" then <BR><BR><BR>HTH.<BR>D.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts