code works on IE https but not http?

Author Message
carmichaelscott

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 11/18/2007
  • Status: offline
code works on IE https but not http? Sunday, November 18, 2007 11:50 AM (permalink)
0
Hi,

I'm having a really weird problem with some code and hoping for a little help/ideas.

Just to explain what's going on briefly... I've added an include to the top of all files on our site (this code is pasted below) to check IP address, and then some pages will display slightly different content for our Canadian or US customers.

This works fine in Firefox. However, in IE, when a Canadian visitor comes it doesn't display canadian content on the http version of any page. Once they go to a https page, it works just fine. After that, if they go back to an http page it still displays properly.

The code is as follows:

-----------------------------------------------------------------
        customerCountry = Session("CustomerCountry")
        IF CustomerCountry = "" OR CustomerCountry = null THEN
            Dim connIPIP  ' ADO connIPection
            Dim rstIP
            Dim strDBPathIP  ' path to our Access database (*.mdb) file
            Dim queryIP
           
            strDBPathIP = Server.MapPath("/Database/ipcountry.mdb")
            Set connIP = Server.CreateObject("ADODB.connection")
            connIP.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPathIP & ";"
           
            ip=request.servervariables("REMOTE_ADDR")
            myIP=split(ip,".")
            IPnumber=(myIp(0)*16777216)+(myIP(1)*65536)+(myIP(2)*256)+(myIP(3))
           
            queryIP="Select * from Countries Where IP_FROM<=" & IPnumber & " AND IP_TO>=" & IPnumber & ";"
            Set rstIP = connIP.Execute(queryIP)
            IF NOT rstIP.EOF THEN
                IF rstIP("COUNTRY_CODE2") = "CA" THEN
                    customerCountry = "CA"
                ELSE
                    customerCountry = "US"
                END IF
                Session("CustomerCountry") = customerCountry
            END IF
            rstIP.close
            set rstIP = nothing
            connIP.close
            set connIP = nothing
        END IF
-----------------------------------------------------------------

Any ideas as to why this might happen?

Thanks in advance,

Scott
 
#1
    webber123456

    • Total Posts : 58
    • Scores: 0
    • Reward points : 0
    • Joined: 9/20/2007
    • Status: offline
    RE: code works on IE https but not http? Wednesday, November 21, 2007 3:36 AM (permalink)
    0
    If the code works in forefox then it is not a coding problem,   it is a browser problem indicating the problem is not with code running on the server (ASP).

    Since you are using the session object make sure both browsers have cookies enabled.

    This may also help

    http://support.microsoft.com/kb/274149
    <message edited by webber123456 on Wednesday, November 21, 2007 3:44 AM>
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9