Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem with sessions / external javascript files in IE6 only

fmaxwell@gmail.com
Guest
 
Posts: n/a
#1: Jan 11 '07
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
Guest
 
Posts: n/a
#2: Jan 11 '07

re: Problem with sessions / external javascript files in IE6 only


fmaxwell@gmail.com wrote:
Quote:
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@attglobal.net
==================
Frances
Guest
 
Posts: n/a
#3: Jan 16 '07

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_limiter('none');
$_SESSION["allow_script"] = "allow_script";

In the external javascript file:

<?php
session_start();
if (isset($_SESSION["allow_script"]))
{
if($_SESSION["allow_script"] == "allow_script")
{
?>

javascript code here

<?
unset($_SESSION["allow_script"]);
}
}
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:
Quote:
fmaxwell@gmail.com wrote:
Quote:
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@attglobal.net
==================
Frances
Guest
 
Posts: n/a
#4: Jan 16 '07

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:
Quote:
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_limiter('none');
$_SESSION["allow_script"] = "allow_script";
>
In the external javascript file:
>
<?php
session_start();
if (isset($_SESSION["allow_script"]))
{
if($_SESSION["allow_script"] == "allow_script")
{
?>
>
javascript code here
>
<?
unset($_SESSION["allow_script"]);
}
}
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:
>
Quote:
fmaxwell@gmail.com wrote:
Quote:
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@attglobal.net
==================
Jerry Stuckle
Guest
 
Posts: n/a
#5: Jan 18 '07

re: Problem with sessions / external javascript files in IE6 only


Frances wrote:
Quote:
Jerry Stuckle wrote:
>
Quote:
>fmaxwell@gmail.com wrote:
Quote:
>>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@attglobal.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_limiter('none');
$_SESSION["allow_script"] = "allow_script";
>
In the external javascript file:
>
<?php
session_start();
if (isset($_SESSION["allow_script"]))
{
if($_SESSION["allow_script"] == "allow_script")
{
?>
>
javascript code here
>
<?
unset($_SESSION["allow_script"]);
}
}
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@attglobal.net
==================
Closed Thread