session_start problems with FireFox on Mac

This is a discussion on session_start problems with FireFox on Mac within the PHP General forums, part of the PHP Programming Forums category; Sorry if this is the wrong place to ask this question... if so please help me figure out where to ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-11-2008
Terry Calie
 
Posts: n/a
Default session_start problems with FireFox on Mac

Sorry if this is the wrong place to ask this question... if so please
help me figure out where to ask it. I've asked on FireFox forums and
was told it was a PHP problem and to ask the developers of PHP.

I have a PHP website that freezes in Firefox on a Mac. Every other
browser/operating system combination I have tested is fine. I've
narrowed down the problem to having to do with "session_start", which is
the session tracking mechanism for php.

When I comment out session_start, the site works (but of course my site
now becomes state-less). Again, the problem is ONLY on FireFox on a
Mac. It works fine on FireFox on a PC.

Any ideas as to what could be causing the problem with FireFox on Mac
and not on PC? (Safari on Mac works fine)

Thanks,
Terry
Reply With Quote
  #2 (permalink)  
Old 01-11-2008
kendalk08
 
Posts: n/a
Default Re: session_start problems with FireFox on Mac

On Jan 11, 10:34*am, phpde...@dedicatedmanagers.com (Terry Calie)
wrote:
> Sorry if this is the wrong place to ask this question... if so please
> help me figure out where to ask it. *I've asked on FireFox forums and
> was told it was a PHP problem and to ask the developers of PHP.
>
> I have a PHP website that freezes in Firefox on a Mac. *Every other
> browser/operating system combination I have tested is fine. *I've
> narrowed down the problem to having to do with "session_start", which is
> the session tracking mechanism for php.
>
> When I comment out session_start, the site works (but of course my site
> now becomes state-less). *Again, the problem is ONLY on FireFox on a
> Mac. *It works fine on FireFox on a PC.
>
> Any ideas as to what could be causing the problem with FireFox on Mac
> and not on PC? *(Safari on Mac works fine)
>
> Thanks,
> Terry


Could you post an example of what you are trying to accomplish please.
I've worked in FireFox and I've never had a problem with session_start
not working.

Ill do the best i can,
Kendal Knabe
Reply With Quote
  #3 (permalink)  
Old 01-11-2008
Jason Pruim
 
Posts: n/a
Default Re: [PHP] session_start problems with FireFox on Mac

With a problem like that, code and a web page are very helpful to
track it down. I'm willing to take a look at what I can with my Mac &
firefox, and see what I can sort out :)

I just need more info..


On Jan 11, 2008, at 11:34 AM, Terry Calie wrote:

> Sorry if this is the wrong place to ask this question... if so
> please help me figure out where to ask it. I've asked on FireFox
> forums and was told it was a PHP problem and to ask the developers
> of PHP.
>
> I have a PHP website that freezes in Firefox on a Mac. Every other
> browser/operating system combination I have tested is fine. I've
> narrowed down the problem to having to do with "session_start",
> which is the session tracking mechanism for php.
>
> When I comment out session_start, the site works (but of course my
> site now becomes state-less). Again, the problem is ONLY on FireFox
> on a Mac. It works fine on FireFox on a PC.
>
> Any ideas as to what could be causing the problem with FireFox on
> Mac and not on PC? (Safari on Mac works fine)
>
> Thanks,
> Terry
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
japruim@raoset.com
Reply With Quote
  #4 (permalink)  
Old 01-11-2008
Daniel Brown
 
Posts: n/a
Default Re: [PHP] session_start problems with FireFox on Mac

On Jan 11, 2008 11:53 AM, Jason Pruim <japruim@raoset.com> wrote:
> With a problem like that, code and a web page are very helpful to
> track it down. I'm willing to take a look at what I can with my Mac &
> firefox, and see what I can sort out :)
>
> I just need more info..
>
>
>
> On Jan 11, 2008, at 11:34 AM, Terry Calie wrote:
>
> > Sorry if this is the wrong place to ask this question... if so
> > please help me figure out where to ask it. I've asked on FireFox
> > forums and was told it was a PHP problem and to ask the developers
> > of PHP.
> >
> > I have a PHP website that freezes in Firefox on a Mac. Every other
> > browser/operating system combination I have tested is fine. I've
> > narrowed down the problem to having to do with "session_start",
> > which is the session tracking mechanism for php.
> >
> > When I comment out session_start, the site works (but of course my
> > site now becomes state-less). Again, the problem is ONLY on FireFox
> > on a Mac. It works fine on FireFox on a PC.
> >
> > Any ideas as to what could be causing the problem with FireFox on
> > Mac and not on PC? (Safari on Mac works fine)


Terry,

I had seen your posts before (I'm a Mozilla developer as well),
but I didn't see mention of a version. What Mac FF version are you
using, and what plugins do you have installed? Try disabling all
plugins, restarting Firefox, and seeing if it will work for you then.

--
</Dan>

Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since
Nineteen-Seventy-[mumble].
Reply With Quote
  #5 (permalink)  
Old 01-11-2008
Richard Lynch
 
Posts: n/a
Default Re: [PHP] session_start problems with FireFox on Mac

Install Live HTTP Headers and see what headers are being sent.

Then search for those headers and FireFox Mac issues online.

On Fri, January 11, 2008 10:34 am, Terry Calie wrote:
> Sorry if this is the wrong place to ask this question... if so please
> help me figure out where to ask it. I've asked on FireFox forums and
> was told it was a PHP problem and to ask the developers of PHP.
>
> I have a PHP website that freezes in Firefox on a Mac. Every other
> browser/operating system combination I have tested is fine. I've
> narrowed down the problem to having to do with "session_start", which
> is
> the session tracking mechanism for php.
>
> When I comment out session_start, the site works (but of course my
> site
> now becomes state-less). Again, the problem is ONLY on FireFox on a
> Mac. It works fine on FireFox on a PC.
>
> Any ideas as to what could be causing the problem with FireFox on Mac
> and not on PC? (Safari on Mac works fine)
>
> Thanks,
> Terry
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
Reply With Quote
  #6 (permalink)  
Old 01-12-2008
Terry Calie
 
Posts: n/a
Default Re: [PHP] session_start problems with FireFox on Mac

Hey... thanks for the replies. I installed the headers feature that
Richard suggested and found that no headers were output.

I started to transfer my php to another site to see if the problem
replicated and I wasn't able to recreate the problem.

It turns out that I "require" a file before the session_start that had
one stupid character of whitespace at the end of it. When I transferred
the php to recreate the problem, I replaced the "require" call with the
actual code - eliminating the whitespace at the end of the file, so the
problem didn't replicate. It took me a long time to figure out that was
the problem. What a killer!

To illustrate my php goes like this:

index.php
=========
<?php
code
code
require "index2.php"
code
?>

index2.php
========
<?php
code
code
code
?>
<whitespace character>

The <whitespace character> is actually just an extra newline "\n" at the
end of the file. So that gets output to the browser before the headers
and apparently doesn't lock up any browsers except FireFox on a Mac.

Thanks for the help. Just your courtesy in responses got me thinking in
a new direction.
Terry




Richard Lynch wrote:
> Install Live HTTP Headers and see what headers are being sent.
>
> Then search for those headers and FireFox Mac issues online.
>
> On Fri, January 11, 2008 10:34 am, Terry Calie wrote:
>
>> Sorry if this is the wrong place to ask this question... if so please
>> help me figure out where to ask it. I've asked on FireFox forums and
>> was told it was a PHP problem and to ask the developers of PHP.
>>
>> I have a PHP website that freezes in Firefox on a Mac. Every other
>> browser/operating system combination I have tested is fine. I've
>> narrowed down the problem to having to do with "session_start", which
>> is
>> the session tracking mechanism for php.
>>
>> When I comment out session_start, the site works (but of course my
>> site
>> now becomes state-less). Again, the problem is ONLY on FireFox on a
>> Mac. It works fine on FireFox on a PC.
>>
>> Any ideas as to what could be causing the problem with FireFox on Mac
>> and not on PC? (Safari on Mac works fine)
>>
>> Thanks,
>> Terry
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>

>
>
>

Reply With Quote
  #7 (permalink)  
Old 01-13-2008
Anup Shukla
 
Posts: n/a
Default Re: [PHP] session_start problems with FireFox on Mac

Terry Calie wrote:
> Hey... thanks for the replies. I installed the headers feature that
> Richard suggested and found that no headers were output.
> I started to transfer my php to another site to see if the problem
> replicated and I wasn't able to recreate the problem.
> It turns out that I "require" a file before the session_start that had
> one stupid character of whitespace at the end of it. When I transferred
> the php to recreate the problem, I replaced the "require" call with the
> actual code - eliminating the whitespace at the end of the file, so the
> problem didn't replicate. It took me a long time to figure out that was
> the problem. What a killer!
>


You may use ob_clean() just before the header()
to get rid of the extra whitespaces.

--
Regards,
Anup Shukla
Reply With Quote
  #8 (permalink)  
Old 01-13-2008
Jochem Maas
 
Posts: n/a
Default Re: [PHP] session_start problems with FireFox on Mac

Terry Calie schreef:

....

>
> To illustrate my php goes like this:
>
> index.php
> =========
> <?php
> code
> code
> require "index2.php"
> code
> ?>
>
> index2.php
> ========
> <?php
> code
> code
> code
> ?>
> <whitespace character>


....

to avoid this in future never add the closing php bracket to the end of
the php file (unless you explicitly want to output something after the
code in question - which is almost never the case), it is not required.

e.g.

--------- >8 info.php ----------------
<?php

phpinfo();
--------- >8 info.php ----------------
Reply With Quote
  #9 (permalink)  
Old 01-13-2008
Europus
 
Posts: n/a
Default Re: [PHP] session_start problems with FireFox on Mac

Jochem Maas wrote:

>> ?>
>> <whitespace character>

> ...
> to avoid this in future never add the closing php bracket to the end of
> the php file (unless you explicitly want to output something after the
> code in question - which is almost never the case), it is not required.
>
> e.g.
> --------- >8 info.php ----------------
> <?php
>
> phpinfo();
> --------- >8 info.php ----------------


I didn't know that. Does the underlying engine in PHP provide the
otherwise missing tag? Does the described problem only happen with
FF on Mac or does it affect other browsers on other OSes?

Ulex
Reply With Quote
  #10 (permalink)  
Old 01-13-2008
Jochem Maas
 
Posts: n/a
Default Re: [PHP] session_start problems with FireFox on Mac

Europus schreef:
> Jochem Maas wrote:
>
>>> ?>
>>> <whitespace character>

>> ...
>> to avoid this in future never add the closing php bracket to the end of
>> the php file (unless you explicitly want to output something after the
>> code in question - which is almost never the case), it is not required.
>>
>> e.g.
>> --------- >8 info.php ----------------
>> <?php
>>
>> phpinfo();
>> --------- >8 info.php ----------------

>
> I didn't know that. Does the underlying engine in PHP provide the
> otherwise missing tag?


the tag is not missing as such - the tag denotes the end of string that
php parses - it's quite logical to assume that the end of a file means the same
thing (especially when you consider that any file you include/require
must specify '<?php' to 'awaken' the php parser)

> Does the described problem only happen with
> FF on Mac or does it affect other browsers on other OSes?


I have never seen this problem effect just one browser on on platform -
afaic it's a general problem that effects all browsers - you can't send
out HTTP headers after HTTP content ... now it maybe that some browsers
these days see fit to ignore white space before the headers (or maybe
just ignore a "\n") but I doubt it ... honestly I can't see how php
would even send the headers after the "\n" had been output ... either
you error logging level is too low, your not reading the error log or you
have error suppression on the header() function (.e.g @header()). all
of these would give you the incorrect notion that the header function
was working, all of these are bad practice.

you also mentioned you changed the code when trying to test it on another
machine - don't do that, test one thing at a time.

anyway problem solved, preventative knowledge aquired, onto the next hurdle :-)

>
> Ulex
>

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:30 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0