mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
sessions are now written via a _php_session_shutdown which is registered
via php_register_pre_request_shutdown().
This commit is contained in:
parent
3ff75e5b8b
commit
64c6e1e90e
2 changed files with 21 additions and 1 deletions
|
@ -156,6 +156,7 @@ void session_adapt_uris(const char *, uint, char **, uint *);
|
|||
#endif
|
||||
|
||||
void _php_session_auto_start(void *data);
|
||||
void _php_session_shutdown(void *data);
|
||||
|
||||
#if HAVE_WDDX
|
||||
#define WDDX_SERIALIZER
|
||||
|
|
|
@ -1173,6 +1173,17 @@ void _php_session_auto_start(void *data)
|
|||
_php_session_start(PSLS_C);
|
||||
}
|
||||
|
||||
void _php_session_shutdown(void *data)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
PHP_RINIT_FUNCTION(session)
|
||||
{
|
||||
PSLS_FETCH();
|
||||
|
@ -1189,11 +1200,16 @@ PHP_RINIT_FUNCTION(session)
|
|||
php_register_post_request_startup(_php_session_auto_start, NULL);
|
||||
}
|
||||
|
||||
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) {
|
||||
|
@ -1201,7 +1217,10 @@ PHP_RSHUTDOWN_FUNCTION(session)
|
|||
PS(nr_open_sessions)--;
|
||||
}
|
||||
php_rshutdown_session_globals(PSLS_C);
|
||||
return SUCCESS;
|
||||
|
||||
*/
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MINIT_FUNCTION(session)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue