cvs: /php4/ext/session session.c
| From: | Sascha Schumann | Date: | Sat, 15 Jan 2000 13:21:10 +0000 |
| Subject: | cvs: /php4/ext/session session.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-9142@lists.php.net to get a copy of this message | ||
sas Sat Jan 15 05:21:10 2000 EDT
Modified files:
/php4/ext/session session.c
Log:
Be more verbose, if headers were already sent and remove RSHUTDOWN handler
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.93 php4/ext/session/session.c:1.94
--- php4/ext/session/session.c:1.93 Sat Jan 15 05:09:32 2000
+++ php4/ext/session/session.c Sat Jan 15 05:20:39 2000
@@ -101,7 +101,6 @@
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 @@
"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 @@
{
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 @@
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));
@@ -1203,24 +1212,6 @@
php_register_pre_request_shutdown(_php_session_shutdown, NULL);
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)