Changeset 17697
- Timestamp:
- 09/25/08 16:02:11 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom/config/midcom_config.php
r17635 r17697 71 71 * <b>Authentication Backend configuration: "simple"</b> 72 72 * 73 * - <b>auth_backend_simple_cookie_secure:</b> Set the "secure" flag on cookie, defaults to true, applies only when actually using SSL/TLS 73 74 * - <b>auth_backend_simple_cookie_id:</b> The ID appended to the cookie prefix, separating 74 75 * auth cookies for different sites. Defaults to the GUID of the current host. … … 344 345 $GLOBALS['midcom_config_default']['auth_backend_simple_cookie_path'] = $_MIDGARD['self']; 345 346 $GLOBALS['midcom_config_default']['auth_backend_simple_cookie_domain'] = null; 347 $GLOBALS['midcom_config_default']['auth_backend_simple_cookie_secure'] = true; // set secure flag on cookie (applies only when using SSL) 346 348 347 349 // Where to redirect the user after a successful login trunk/midcom/midcom.core/midcom/services/auth/backend/simple.php
r17556 r17697 130 130 function _set_cookie() 131 131 { 132 if ($GLOBALS['midcom_config']['auth_backend_simple_cookie_domain']) 132 $secure_cookie = false; 133 if ( isset($_SERVER['HTTPS']) 134 && !empty($_SERVER['HTTPS']) 135 && $GLOBALS['midcom_config']['auth_backend_simple_cookie_secure']) 133 136 { 134 setcookie 135 ( 136 $this->_cookie_id, 137 "{$this->session_id}-{$this->user->id}", 138 0, 139 $GLOBALS['midcom_config']['auth_backend_simple_cookie_path'], 140 $GLOBALS['midcom_config']['auth_backend_simple_cookie_domain'] 141 ); 137 $secure_cookie = true; 142 138 } 143 else 144 { 145 setcookie 146 ( 147 $this->_cookie_id, 148 "{$this->session_id}-{$this->user->id}", 149 0, 150 $GLOBALS['midcom_config']['auth_backend_simple_cookie_path'] 151 ); 152 } 139 setcookie 140 ( 141 $this->_cookie_id, 142 "{$this->session_id}-{$this->user->id}", 143 0, 144 $GLOBALS['midcom_config']['auth_backend_simple_cookie_path'], 145 $GLOBALS['midcom_config']['auth_backend_simple_cookie_domain'], 146 $secure_cookie 147 ); 153 148 } 154 149 … … 159 154 function _delete_cookie() 160 155 { 161 if ($GLOBALS['midcom_config']['auth_backend_simple_cookie_domain']) 162 { 163 setcookie 164 ( 165 $this->_cookie_id, 166 false, 167 0, 168 $GLOBALS['midcom_config']['auth_backend_simple_cookie_path'], 169 $GLOBALS['midcom_config']['auth_backend_simple_cookie_domain'] 170 ); 171 } 172 else 173 { 174 setcookie 175 ( 176 $this->_cookie_id, 177 false, 178 0, 179 $GLOBALS['midcom_config']['auth_backend_simple_cookie_path'] 180 ); 181 } 156 setcookie 157 ( 158 $this->_cookie_id, 159 false, 160 0, 161 $GLOBALS['midcom_config']['auth_backend_simple_cookie_path'], 162 $GLOBALS['midcom_config']['auth_backend_simple_cookie_domain'] 163 ); 182 164 } 183 165
