summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>1999-10-22 08:10:08 +0000
committerSascha Schumann <sas@php.net>1999-10-22 08:10:08 +0000
commit23882d31c4bbca2e545c9895fb4d1d1268fd957d (patch)
tree733e9bc0b47528cbdc90f17f25bb9ec8aa463ab1
parent3e307aacc49af00232cbf37f154aa30ce8c70aad (diff)
downloadphp-git-23882d31c4bbca2e545c9895fb4d1d1268fd957d.tar.gz
Add session.use_cookies option
-rw-r--r--NEWS3
-rw-r--r--ext/session/php_session.h1
-rw-r--r--ext/session/session.c9
-rw-r--r--php.ini-dist1
4 files changed, 12 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 2466f437a4..d401de98fa 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,8 @@ PHP 4.0 NEWS
?? ?? 1999, Version 4.0 Beta 3
-- added getcwd() function. (Thies)
+- Added session.use_cookies option (Sascha)
+- Added getcwd() function. (Thies)
- XML_Parse_Into_Struct no longer eats data. (Thies)
- Fixed parse_url('-') crash. (Thies)
- added === operator support. (Andi & Thies, Zend library)
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 10fd555b54..763a9e2ae1 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -79,6 +79,7 @@ typedef struct {
int entropy_length;
int lifetime;
zend_bool define_sid;
+ zend_bool use_cookies;
ps_module *mod;
void *mod_data;
HashTable vars;
diff --git a/ext/session/session.c b/ext/session/session.c
index 313af12ed3..a68748d60c 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -70,6 +70,7 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, NULL)
PHP_INI_ENTRY("session.lifetime", "0", PHP_INI_ALL, NULL)
PHP_INI_ENTRY("session.serialize_handler", "php", PHP_INI_ALL, NULL)
+ PHP_INI_ENTRY("session.use_cookies", "1", PHP_INI_ALL, NULL)
PHP_INI_ENTRY("session.extern_referer_check", "", PHP_INI_ALL, NULL)
PHP_INI_ENTRY("session.entropy_file", "", PHP_INI_ALL, NULL)
PHP_INI_ENTRY("session.entropy_length", "0", PHP_INI_ALL, NULL)
@@ -508,7 +509,12 @@ static void _php_session_start(PSLS_D)
if(!PS(id)) {
PS(id) = _php_create_id(NULL PSLS_CC);
}
-
+
+ if(!PS(use_cookies) && send_cookie) {
+ define_sid = 1;
+ send_cookie = 0;
+ }
+
if(send_cookie) {
_php_session_send_cookie(PSLS_C);
}
@@ -854,6 +860,7 @@ static void php_rinit_session_globals(PSLS_D)
zend_hash_init(&PS(vars), 0, NULL, NULL, 0);
PS(define_sid) = 0;
+ PS(use_cookies) = INI_INT("session.use_cookies");
PS(save_path) = estrdup(INI_STR("session.save_path"));
PS(session_name) = estrdup(INI_STR("session.name"));
PS(entropy_file) = estrdup(INI_STR("session.entropy_file"));
diff --git a/php.ini-dist b/php.ini-dist
index 896e9b24bc..ad62399820 100644
--- a/php.ini-dist
+++ b/php.ini-dist
@@ -273,6 +273,7 @@ session.save_handler = files ; handler used to store/retrieve data
session.save_path = /tmp ; argument passed to save_handler
; in the case of files, this is the
; path where data files are stored
+session.use_cookies = 1 ; whether to use cookies
session.name = PHPSESSID ; name of the session
; is used as cookie name
session.auto_start = 0 ; initialize session on request startup