PHP 4.0 Bug #8556: start_session modify the HTTP header

From: Date: Thu, 04 Jan 2001 21:11:45 +0000
Subject: PHP 4.0 Bug #8556: start_session modify the HTTP header
Groups: php.dev 
Request: Send a blank email to php-dev+get-42988@lists.php.net to get a copy of this message
From: georges.dagousset@oxios.fr Operating system: all PHP version: 4.0.4 PHP Bug Type: *Session related Bug description: start_session modify the HTTP header This related to bug #8073 You are right when you said it is necessary to send a header with no-cache when php send a cookie. But I think it is not normal to change the header when php sends no cookie. So I changed the code: before ... if (send_cookie) php_session_send_cookie(PSLS_C); if (define_sid) { char *buf; buf = emalloc(strlen(PS(session_name)) + strlen(PS(id)) + 5); sprintf(buf, "%s=%s", PS(session_name), PS(id)); REGISTER_STRING_CONSTANT("SID", buf, 0); } else REGISTER_STRING_CONSTANT("SID", empty_string, 0); PS(define_sid) = define_sid; PS(nr_open_sessions)++; php_session_cache_limiter(PSLS_C); php_session_initialize(PSLS_C); ... after the change ... if (send_cookie) { php_session_send_cookie(PSLS_C); php_session_cache_limiter(PSLS_C); } if (define_sid) { char *buf; buf = emalloc(strlen(PS(session_name)) + strlen(PS(id)) + 5); sprintf(buf, "%s=%s", PS(session_name), PS(id)); REGISTER_STRING_CONSTANT("SID", buf, 0); } else REGISTER_STRING_CONSTANT("SID", empty_string, 0); PS(define_sid) = define_sid; PS(nr_open_sessions)++; php_session_initialize(PSLS_C); ... With this modification the no-cache header is send only once. Maybe the modification is made a wrong way!? Georges Dagousset France :-) -- Edit Bug report at: http://bugs.php.net/?id=8556&edit=1

« previous php.dev (#42988) next »