summaryrefslogtreecommitdiff
path: root/ext/session
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2000-03-30 18:50:09 +0000
committerSterling Hughes <sterling@php.net>2000-03-30 18:50:09 +0000
commit149e6181e53c412ea9f760dc658502fc251cd628 (patch)
tree2dbe5418e446c5c5ce6deb0cb9d7ac583c74e211 /ext/session
parent5f6ad555430a64068354bf81fa108a49bebd91f4 (diff)
downloadphp-git-149e6181e53c412ea9f760dc658502fc251cd628.tar.gz
@-added session_get_cookie_params (sterling)
Diffstat (limited to 'ext/session')
-rw-r--r--ext/session/php_session.h1
-rw-r--r--ext/session/session.c22
2 files changed, 23 insertions, 0 deletions
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index a017ab1e3e..a93f4d87f4 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -112,6 +112,7 @@ PHP_FUNCTION(session_destroy);
PHP_FUNCTION(session_unset);
PHP_FUNCTION(session_set_save_handler);
PHP_FUNCTION(session_set_cookie_params);
+PHP_FUNCTION(session_get_cookie_params);
#ifdef ZTS
#define PSLS_D php_ps_globals *ps_globals
diff --git a/ext/session/session.c b/ext/session/session.c
index 142570a989..45ef383b2f 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -62,6 +62,7 @@ function_entry session_functions[] = {
PHP_FE(session_unset, NULL)
PHP_FE(session_set_save_handler, NULL)
PHP_FE(session_set_cookie_params, NULL)
+ PHP_FE(session_get_cookie_params, NULL)
{0}
};
@@ -873,6 +874,27 @@ PHP_FUNCTION(session_set_cookie_params)
}
/* }}} */
+/* {{{ proto array session_get_cookie_params()
+ Return the session cookie parameters */
+
+PHP_FUNCTION(session_get_cookie_params) {
+ PSLS_FETCH();
+
+ if (ARG_COUNT(ht) != 0) {
+ WRONG_PARAM_COUNT;
+ }
+
+ if (array_init(return_value) == FAILURE) {
+ php_error(E_ERROR, "Cannot initialize return value from session_get_cookie_parameters");
+ RETURN_FALSE;
+ }
+
+ add_assoc_string( return_value, "lifetime", PS(cookie_lifetime) );
+ add_assoc_string( return_value, "path", PS(cookie_path) );
+ add_assoc_string( return_value, "domain", PS(cookie_domain) );
+}
+
+/* }}} */
/* {{{ proto string session_name([string newname])
Return the current session name. if newname is given, the session name is replaced with newname */