You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Steve Swift <st...@gmail.com> on 2006/11/24 07:46:54 UTC

[users@httpd] Close browser session while CGI is still active

Can a CGI script close the session with the browser before it exits?

I tried closing STDOUT and STDERR in the hope that Apache might notice, and
clean up the session, but the browser remained waiting.

I have a CGI script that send its page to the browser then has a "batch" job
to do, which takes several minutes.
At the moment I'm handling it by creating a detached task to run the batch
portion but since the batch process requires access to the variables that
built the HTML page it would be much simpler if I could manage it in one run
of the CGI script.

-- 
Steve Swift
http://www.swiftys.org.uk

Re: [users@httpd] Close browser session while CGI is still active

Posted by Joshua Slive <jo...@slive.ca>.
On 11/24/06, Steve Swift <st...@gmail.com> wrote:
> Can a CGI script close the session with the browser before it exits?
>
> I tried closing STDOUT and STDERR in the hope that Apache might notice, and
> clean up the session, but the browser remained waiting.
>
> I have a CGI script that send its page to the browser then has a "batch" job
> to do, which takes several minutes.
> At the moment I'm handling it by creating a detached task to run the batch
> portion but since the batch process requires access to the variables that
> built the HTML page it would be much simpler if I could manage it in one run
> of the CGI script.

http://www.htmlhelp.com/faq/cgifaq.3.html#8

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Close browser session while CGI is still active

Posted by Steve Swift <st...@gmail.com>.
That's what I'm doing now, but its cumbersome.  I'd hoped that I could get
away with a couple of closes, but no such luck.
It happens quite often in my CGI scripts that I finish the webpage then have
to do some tidying-up that just keeps the browser waiting.

On 24/11/06, long <xi...@yahoo.com> wrote:
>
> Since you already using a detached task to run the batch job, if it's not
> too much work and the result of the batch job is not a requirement for the
> response, can you just pass your variables to the batch job?



-- 
Steve Swift
http://www.swiftys.org.uk

Re: [users@httpd] Close browser session while CGI is still active

Posted by long <xi...@yahoo.com>.
Since you already using a detached task to run the batch job, if it's not too much work and the result of the batch job is not a requirement for the response, can you just pass your variables to the batch job?

Steve Swift <st...@gmail.com> wrote:  Can a CGI script close the session with the browser before it exits?

I tried closing STDOUT and STDERR in the hope that Apache might notice, and clean up the session, but the browser remained waiting.

I have a CGI script that send its page to the browser then has a "batch" job to do, which takes several minutes. 
At the moment I'm handling it by creating a detached task to run the batch portion but since the batch process requires access to the variables that built the HTML page it would be much simpler if I could manage it in one run of the CGI script. 

-- 
Steve Swift
http://www.swiftys.org.uk 

 
---------------------------------
Access over 1 million songs - Yahoo! Music Unlimited.