Browse Source

Be more verbose, if headers were already sent and remove RSHUTDOWN handler

PHP-4.0.5
Sascha Schumann 27 years ago
parent
commit
a0b08b5e0b
  1. 31
      ext/session/session.c

31
ext/session/session.c

@ -101,7 +101,6 @@ const static ps_serializer ps_serializers[] = {
PHP_MINIT_FUNCTION(session);
PHP_RINIT_FUNCTION(session);
PHP_MSHUTDOWN_FUNCTION(session);
PHP_RSHUTDOWN_FUNCTION(session);
PHP_MINFO_FUNCTION(session);
static void php_rinit_session_globals(PSLS_D);
@ -111,7 +110,7 @@ zend_module_entry session_module_entry = {
"Session Management",
session_functions,
PHP_MINIT(session), PHP_MSHUTDOWN(session),
PHP_RINIT(session), PHP_RSHUTDOWN(session),
PHP_RINIT(session), NULL,
PHP_MINFO(session),
STANDARD_MODULE_PROPERTIES,
};
@ -525,6 +524,11 @@ static void _php_session_cache_limiter(PSLS_D)
{
php_session_cache_limiter *lim;
if (SG(headers_sent)) {
php_error(E_WARNING, "Cannot send session cache limiter - headers already sent");
return;
}
for (lim = php_session_cache_limiters; lim->name; lim++) {
if (!strcasecmp(lim->name, PS(cache_limiter))) {
lim->func(PSLS_C);
@ -546,6 +550,11 @@ static void _php_session_send_cookie(PSLS_D)
char *cookie;
char *date_fmt = NULL;
if (SG(headers_sent)) {
php_error(E_WARNING, "Cannot send session cookie - headers already sent");
return;
}
len = strlen(PS(session_name)) + strlen(PS(id)) + sizeof(COOKIE_FMT);
if (PS(cookie_lifetime) > 0) {
date_fmt = php_std_date(time(NULL) + PS(cookie_lifetime));
@ -1205,24 +1214,6 @@ PHP_RINIT_FUNCTION(session)
return SUCCESS;
}
PHP_RSHUTDOWN_FUNCTION(session)
{
/*
this now done in _php_session_shutdown
PSLS_FETCH();
if(PS(nr_open_sessions) > 0) {
_php_session_save_current_state(PSLS_C);
PS(nr_open_sessions)--;
}
php_rshutdown_session_globals(PSLS_C);
*/
return SUCCESS;
}
PHP_MINIT_FUNCTION(session)
{
#ifdef ZTS

Loading…
Cancel
Save