473,508 Members | 4,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jan 11 '07 #1
4 2634
fm******@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.
js*******@attglobal.net
==================
Jan 11 '07 #2
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:
fm******@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.
js*******@attglobal.net
==================
Jan 16 '07 #3
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_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:
fm******@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.
js*******@attglobal.net
==================
Jan 16 '07 #4
Frances wrote:
Jerry Stuckle wrote:
>fm******@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.
js*******@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.
js*******@attglobal.net
==================
Jan 18 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2622
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php';...
1
2442
by: Ali Asghar | last post by:
Hi, Please I need help.I have a problem of client side XSL transformation. I sent the XML and the XSL to the client in XML data islands. Using the transform Node method the HTML is returned....
9
6880
by: Charley Kyd | last post by:
I'm a newbie who needs advice about how to use external files of JavaScript code. I spent an hour this afternoon browsing through JavaScript books at the local book store. In about 15 different...
3
3690
by: Will Woodhull | last post by:
Hi, I'm new here-- I've been reading the group for a couple of days. Nice group; I like the way n00b33 questions are handled. I've been using a Javascript routine in index.html to determine a...
3
3015
by: Altman | last post by:
We just recently got an MSDN subscription and obtained a copy of .Net. I am trying to convert a VC++ 6.0 code to .net and when I try to build it I get the following error C:\Program...
1
2236
by: mb | last post by:
Hi, I picked up this JavaScript code (quiz code) at: http://javascript.internet.com/miscellaneous/multiple-choice-quiz.html and modified it (and may have deleted some line I shouldn't have) so...
4
1559
by: James Pemberton | last post by:
I have recently created a ASP site utilizing Master Pages and all works fine until I want to proces my javascripts. Just to let you know, most of cliewnt side scripting is new to me. But...
3
2702
by: Jon Slaughter | last post by:
Any pitfalls or stuff I need to worry about when working with sessions? I want to write a log file and hit counter along with a login interface and I'm trying to learn this stuff. ...
29
24355
by: FreshRob | last post by:
I have been trying to fix this issue the whole of today and have gotten no where. I am developing a new website, and wanted it to display a webpage in lightbox and have an external page added to the...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.