summaryrefslogtreecommitdiff
path: root/ext/session
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2003-02-18 18:50:44 +0000
committerSascha Schumann <sas@php.net>2003-02-18 18:50:44 +0000
commit32e0c8161ca28adc16e651c0f106b69c2d1f6403 (patch)
treeed33b3b23c6e9768f9e4be5bf243ee2c489606dc /ext/session
parentbcd49d63c3d85f73aa793fda7b110aa4c3c7e188 (diff)
downloadphp-git-32e0c8161ca28adc16e651c0f106b69c2d1f6403.tar.gz
add session_regenerate_id()
Diffstat (limited to 'ext/session')
-rw-r--r--ext/session/php_session.h1
-rw-r--r--ext/session/session.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 72b67c6a53..4e850807ec 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -132,6 +132,7 @@ PHP_FUNCTION(session_name);
PHP_FUNCTION(session_module_name);
PHP_FUNCTION(session_save_path);
PHP_FUNCTION(session_id);
+PHP_FUNCTION(session_regenerate_id);
PHP_FUNCTION(session_decode);
PHP_FUNCTION(session_register);
PHP_FUNCTION(session_unregister);
diff --git a/ext/session/session.c b/ext/session/session.c
index d575474cbc..74398b261d 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -61,6 +61,7 @@ function_entry session_functions[] = {
PHP_FE(session_module_name, NULL)
PHP_FE(session_save_path, NULL)
PHP_FE(session_id, NULL)
+ PHP_FE(session_regenerate_id, NULL)
PHP_FE(session_decode, NULL)
PHP_FE(session_register, NULL)
PHP_FE(session_unregister, NULL)
@@ -1358,6 +1359,20 @@ PHP_FUNCTION(session_id)
}
/* }}} */
+/* {{{ proto string session_regenerate_id()
+ Update the current session id with a newly generated one. */
+PHP_FUNCTION(session_regenerate_id)
+{
+ if (PS(mod)) {
+ if (PS(id)) efree(PS(id));
+
+ PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
+ RETURN_TRUE;
+ }
+ RETURN_FALSE;
+}
+/* }}} */
+
/* {{{ proto string session_cache_limiter([string new_cache_limiter])
Return the current cache limiter. If new_cache_limited is given, the current cache_limiter is replaced with new_cache_limiter */
PHP_FUNCTION(session_cache_limiter)