Problem with sessions / external javascript files in IE6 only

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fmaxwell@gmail.com

    Problem with sessions / external javascript files in IE6 only

    Dear Group

    I have a very frustrating problem. I have been trying to make it more
    difficult to access external javascript files by using PHP sessions.

    This works beautifully locally (both in IE6 and IE7) and online in IE7,
    but frustratingly, online in IE6, the javascript does not render on the
    page, unless you refresh the page.

    Is there something different about the way IE6 handles sessions? Why
    would it work locally but not online?

    Any help would be very much appreciated.

    Thanks
    Frances

  • Jerry Stuckle

    #2
    Re: Problem with sessions / external javascript files in IE6 only

    fmaxwell@gmail. com wrote:
    Dear Group
    >
    I have a very frustrating problem. I have been trying to make it more
    difficult to access external javascript files by using PHP sessions.
    >
    This works beautifully locally (both in IE6 and IE7) and online in IE7,
    but frustratingly, online in IE6, the javascript does not render on the
    page, unless you refresh the page.
    >
    Is there something different about the way IE6 handles sessions? Why
    would it work locally but not online?
    >
    Any help would be very much appreciated.
    >
    Thanks
    Frances
    >
    Sorry, my crystal ball is broken today. We need more information - like
    maybe the code your using.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Frances

      #3
      Re: Problem with sessions / external javascript files in IE6 only

      Dear Jerry

      Thanks for replying. Sorry to hear about your crystal ball :-)

      I guess I was hoping to blame it on some error with IE6 session
      handling, but it must be my fault then. This is my code:

      In the template:

      session_cache_l imiter('none');
      $_SESSION["allow_scri pt"] = "allow_scri pt";

      In the external javascript file:

      <?php
      session_start() ;
      if (isset($_SESSIO N["allow_scri pt"]))
      {
      if($_SESSION["allow_scri pt"] == "allow_scri pt")
      {
      ?>

      javascript code here

      <?
      unset($_SESSION["allow_scri pt"]);
      }
      }
      else
      {
      header("HTTP/1.0 404 Not Found");
      }
      exit();
      ?>

      I can use other PHP code in the external javascript file, so that is
      not the problem. It appears to me that it does not like any reference
      to the session. This is only a problem in IE6. I have tried it
      without unsetting the variable at the end and also without exit(). No
      joy.

      Thanks so much for any pointers
      Frances


      Jerry Stuckle wrote:
      fmaxwell@gmail. com wrote:
      Dear Group

      I have a very frustrating problem. I have been trying to make it more
      difficult to access external javascript files by using PHP sessions.

      This works beautifully locally (both in IE6 and IE7) and online in IE7,
      but frustratingly, online in IE6, the javascript does not render on the
      page, unless you refresh the page.

      Is there something different about the way IE6 handles sessions? Why
      would it work locally but not online?

      Any help would be very much appreciated.

      Thanks
      Frances
      >
      Sorry, my crystal ball is broken today. We need more information - like
      maybe the code your using.
      >
      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • Frances

        #4
        Re: Problem with sessions / external javascript files in IE6 only

        Just to add, it does work in IE6 if you refresh the page everytime you
        navigate around the site.


        Frances wrote:
        Dear Jerry
        >
        Thanks for replying. Sorry to hear about your crystal ball :-)
        >
        I guess I was hoping to blame it on some error with IE6 session
        handling, but it must be my fault then. This is my code:
        >
        In the template:
        >
        session_cache_l imiter('none');
        $_SESSION["allow_scri pt"] = "allow_scri pt";
        >
        In the external javascript file:
        >
        <?php
        session_start() ;
        if (isset($_SESSIO N["allow_scri pt"]))
        {
        if($_SESSION["allow_scri pt"] == "allow_scri pt")
        {
        ?>
        >
        javascript code here
        >
        <?
        unset($_SESSION["allow_scri pt"]);
        }
        }
        else
        {
        header("HTTP/1.0 404 Not Found");
        }
        exit();
        ?>
        >
        I can use other PHP code in the external javascript file, so that is
        not the problem. It appears to me that it does not like any reference
        to the session. This is only a problem in IE6. I have tried it
        without unsetting the variable at the end and also without exit(). No
        joy.
        >
        Thanks so much for any pointers
        Frances
        >
        >
        Jerry Stuckle wrote:
        >
        fmaxwell@gmail. com wrote:
        Dear Group
        >
        I have a very frustrating problem. I have been trying to make it more
        difficult to access external javascript files by using PHP sessions.
        >
        This works beautifully locally (both in IE6 and IE7) and online in IE7,
        but frustratingly, online in IE6, the javascript does not render on the
        page, unless you refresh the page.
        >
        Is there something different about the way IE6 handles sessions? Why
        would it work locally but not online?
        >
        Any help would be very much appreciated.
        >
        Thanks
        Frances
        >
        Sorry, my crystal ball is broken today. We need more information - like
        maybe the code your using.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • Jerry Stuckle

          #5
          Re: Problem with sessions / external javascript files in IE6 only

          Frances wrote:
          Jerry Stuckle wrote:
          >
          >fmaxwell@gmail. com wrote:
          >>Dear Group
          >>>
          >>I have a very frustrating problem. I have been trying to make it more
          >>difficult to access external javascript files by using PHP sessions.
          >>>
          >>This works beautifully locally (both in IE6 and IE7) and online in IE7,
          >>but frustratingly, online in IE6, the javascript does not render on the
          >>page, unless you refresh the page.
          >>>
          >>Is there something different about the way IE6 handles sessions? Why
          >>would it work locally but not online?
          >>>
          >>Any help would be very much appreciated.
          >>>
          >>Thanks
          >>Frances
          >>>
          >Sorry, my crystal ball is broken today. We need more information - like
          >maybe the code your using.
          >>
          >--
          >============== ====
          >Remove the "x" from my email address
          >Jerry Stuckle
          >JDS Computer Training Corp.
          >jstucklex@attgl obal.net
          >============== ====
          >
          Dear Jerry
          >
          Thanks for replying. Sorry to hear about your crystal ball :-)
          >
          I guess I was hoping to blame it on some error with IE6 session
          handling, but it must be my fault then. This is my code:
          >
          In the template:
          >
          session_cache_l imiter('none');
          $_SESSION["allow_scri pt"] = "allow_scri pt";
          >
          In the external javascript file:
          >
          <?php
          session_start() ;
          if (isset($_SESSIO N["allow_scri pt"]))
          {
          if($_SESSION["allow_scri pt"] == "allow_scri pt")
          {
          ?>
          >
          javascript code here
          >
          <?
          unset($_SESSION["allow_scri pt"]);
          }
          }
          else
          {
          header("HTTP/1.0 404 Not Found");
          }
          exit();
          ?>
          >
          I can use other PHP code in the external javascript file, so that is
          not the problem. It appears to me that it does not like any reference
          to the session. This is only a problem in IE6. I have tried it
          without unsetting the variable at the end and also without exit(). No
          joy.
          >
          Thanks so much for any pointers
          Frances
          >
          >
          (Top posting fixed)

          Hi, Francis,

          Hmmm, strange.

          I guess the first question would be - are you sure session_start() is
          being called before *anything* is output?

          But unfortunately, you don't show enough to make any sense. When you
          indicate and "external javascript file" - how are you loading the file?
          If you're including the file (i.e. php include or require statement),
          that's fine. But if you're linking to the file, the link is processed
          by the browser at some time - and it may well be after the page has been
          loaded. So you wouldn't see it in your main page code.

          P.S. Please don't top post.

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          Working...