PHP 4.0 Bug #8556 Updated: start_session modify the HTTP header
| From: | sas@php.net | Date: | Tue, 20 Feb 2001 20:45:11 +0000 |
| Subject: | PHP 4.0 Bug #8556 Updated: start_session modify the HTTP header | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47097@lists.php.net to get a copy of this message | ||
ID: 8556
Updated by: sas
Reported By: georges.dagousset@oxios.fr
Old-Status: Open
Status: Closed
Bug Type: *Session related
Assigned To:
Comments:
Regardless of whether the session id is transmitted by a cookie or the URL, the output of the PHP
script is by default supposed to be non-cachable.
If you think a client can cache the content of the page, change the session.cache_limiter
configuration variable appropiately.
Previous Comments:
---------------------------------------------------------------------------
[2001-01-04 16:11:45] georges.dagousset@oxios.fr
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
:-)
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8556&edit=2