]> granicus.if.org Git - php/commitdiff
Add session.use_cookies option
authorSascha Schumann <sas@php.net>
Fri, 22 Oct 1999 08:10:08 +0000 (08:10 +0000)
committerSascha Schumann <sas@php.net>
Fri, 22 Oct 1999 08:10:08 +0000 (08:10 +0000)
NEWS
ext/session/php_session.h
ext/session/session.c
php.ini-dist

diff --git a/NEWS b/NEWS
index 2466f437a4f63ee885b5eba58b23df44766e6a99..d401de98faac388432b4c89911e84610945e907a 100644 (file)
--- 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)
index 10fd555b546888c32241aab4c1bee7722028ce77..763a9e2ae1be887244368ea4f694ab52bd642c7a 100644 (file)
@@ -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;
index 313af12ed3868cbf425b267d7e5251e4896db82f..a68748d60c89734523c91718e5575053c54131aa 100644 (file)
@@ -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"));
index 896e9b24bc27c5c65f71c07338e43424f5639172..ad62399820cb2d74f9581b9f2723a178f5382150 100644 (file)
@@ -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