Figured out the issue.. it has to do with sessions.  If you have an
existing session when you try to do this, and you refresh the page,
PHP will NOT feed you the new page because the existing session is
still going on (not sure if this is a bug, but this is why you need to
restart the browser or the web server).  To solve this, in your PHP
function/code, before you enter the polling loop, use:

session_write_close();

Make sure you get all the session data you need before you issue this
command.

On May 16, 11:26 am, jheathco <[EMAIL PROTECTED]> wrote:
> I have this SAME issue.  It actually occurs on my own little framework
> I developed similar to CakePHP.... I think it may have to do with
> the .htaccess file strucutre....  If you shutdown the browser, reload
> it and refresh the page, it works.  Or you can restart the Apache
> server, or wait for the script to timeout... what gives?
>
> Any one figure this out?
>
> On Apr 30, 3:23 pm, zaboo <[EMAIL PROTECTED]> wrote:
>
> > I have been trying to develop an AJAX request using a "comet"
> > architecture. (A long-polled HTTP request). Here's the problem:
>
> > If I develop the script within an action of the controller it halts
> > other requests to the cake infrastructure. I believe it is because of
> > the php output buffer, but am not 100% sure. I have no idea why it
> > does this, and cannot seem to do a work around.
>
> > In it's basic form (pseudo):
>
> > <?
> > class myController extends AppController {
> > function comet() {
> > while( condition ) {
> > // do stuff
> > sleep(1);}
>
> > // render view (json)}
> > }
>
> > ?>
>
> > If you were to requesthttp://example.com/my/comet/, it would lock out
> > any further requests until the script has finished.
>
> > If you do the same thing with a standalone PHP script, it is fine.
>
> > I think I am going bonkers trying to figure this out.
>
> > Few part question:
>
> > a) Am I missing something?
> > b) Is there a way around this?
> > c) What is the easiest way to bootstrap all the cake constants &
> > sessions to a standalone script.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to