Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Session Variables...IE V FireFox

    I'm really hoping someone out there is able to help or has at least come across this issue as its driving me nuts.

    I have a very basic form which sets a session variable dependant on the outcome of an event.

    When I write the Session variable to the screen after each event the variable is correct. When I use IE, as soon as the page re-directs to the next page the session variable is for some magical reason lost.

    BUT, and this is the annoying bit...if I run the same process in FireFox, the session variable is retained and the re-directed page works as expected...

    What on earth is all that about ???? I dont think it is a code issue but maybe something of a system or browser setting issue but I cant work it out for love nor money....Any ideas or suggestions will be greatfully welcomed...

    Many Thanks In Advance...
    Last edited by jammy; 01-11-2007 at 11:00 PM. Reason: typos

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    You should check your IE settings....and establish if cookies are enabled or not.

    By default, when you start a session, a cookie is created on the client computer containing the session ID. Without this cookie, the server will have no way to knowing who is who.

    To overcome this problem, you can always inform your users that they must accept cookies from your website, otherwise it won't work as expected.

    Another trick is to include your session id with every url and then read the url with every request. for example,

    Code:
    <a href="http://your_site.com/about.php?SSID=12121009palk1212">about us</a>
    Good luck.
    Ess

  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,027
    Thanks
    2
    Thanked 315 Times in 307 Posts
    Is there a chance that you are switching/redirecting between http and https pages?
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #4
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    All seems fine with cookies being enabled and what not.

    Its also passing to another http page so no change in security or anything like that...

    Very frustrating...

  • #5
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just for reference, the code which sets the session variable is below :

    If rs_Login.EOF AND rs_Login.EOF THEN
    Session("Username") = "error"
    Session("Admin_Access") = 1
    Response.Redirect ("index.asp")
    Else
    Session("Username") = rs_Login("Username")
    Session("User_ID") = rs_Login("user_ID")
    Session("Admin_Access") = rs_Login("Access_Rights")
    Dim strUserID
    strUserID = rs_Login("User_ID")


    rs_Login.Close
    Set rs_Login = Nothing

    Response.Write " CORRECT USERNAME : " & Session("Username") & "<br>"
    Response.Write " ADMIN ACCESS : " & Session("Admin_Access") & "<br>"
    Response.Redirect ("index.asp")

    End If

  • #6
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I guess know one has come across this before then ????

  • #7
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK....been looking in to this further...and still having problems...

    What I have noticed though, is that if I register a new user ( e.g write some data to the tbluser table ) and then try and login to the system if all works fine...

    Anyone got any suggestions as to how to solve this ???? Its really bugging me now and cant find anyone that is able to help or even make suggestions...


  •  

    Posting Permissions

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