in reply to Keeping HTTP sessions alive

A quick search using SuperSearch for the term "keep_alive" turned up just a few threads... not a lot. I see that in this thread liz commented that not all HTTP servers support the keep_alive option. Are you sure yours does?

Also, most of the examples I find set keep_alive to 1, not undef.

Update: Looking into the Apache Webserver source provides some interesting information. At the following link you'll be able to look at just what is required before a connection can be kept alive: http://lxr.webperf.org/source.cgi/modules/http/http_protocol.c#206

The important part starts around line 206:

206 /*The following convoluted conditional determines whether or not 207 *the current connection should remain persistent after this respo +nse 208 *(a.k.a. HTTP Keep-Alive) and whether or not the output message 209 *body should use the HTTP/1.1 chunked transfer-coding. In English +, 210 * 211 * IF we have not marked this connection as errored; 212 * and the response body has a defined length due to the status c +ode 213 * being 304 or 204, the request method being HEAD, already 214 * having defined Content-Length or Transfer-Encoding: chunked, o +r 215 * the request version being HTTP/1.1 and thus capable of being s +et 216 * as chunked [we know the (r->chunked = 1) side-effect is ugly]; 217 * and the server configuration enables keep-alive; 218 * and the server configuration has a reasonable inter-request ti +meout; 219 * and there is no maximum # requests or the max hasn't been reac +hed; 220 * and the response status does not require a close; 221 * and the response generator has not already indicated close; 222 * and the client did not request non-persistence (Connection: cl +ose); 223 * and we haven't been configured to ignore the buggy twit 224 * or they're a buggy twit coming through a HTTP/1.1 proxy 225 * and the client is requesting an HTTP/1.0-style keep-alive 226 * or the client claims to be HTTP/1.1 compliant (perhaps a proxy +); 227 * THEN we can be persistent, which requires more headers be outp +ut. 228 * 229 *Note that the condition evaluation order is extremely important. 230 */

It appears that a number of criteria must be met for it to be possible to keep a session alive.

Based on the above link, I would suggest checking the following:

Hopefully that's enough to get you started.


Dave


"If I had my life to live over again, I'd be a plumber." -- Albert Einstein