Use "secure" flag on SSL connections, thanks to dayton967
This commit is contained in:
@ -58,6 +58,9 @@ Version 2.1 ()
|
||||
Version 2.0.2 ()
|
||||
------------------------------------------------------------------------
|
||||
|
||||
* Use "secure" flag for (session) cookies sent over SSL, thanks to
|
||||
dayton967
|
||||
|
||||
* Make preview_iframe.tpl template files load the proper frontend
|
||||
CSS file, including cache-busting version string when changing
|
||||
themes
|
||||
|
@ -10,6 +10,9 @@ if (defined('S9Y_FRAMEWORK')) {
|
||||
if (!headers_sent() && php_sapi_name() !== 'cli') {
|
||||
// Only set the session name, if no session has yet been issued.
|
||||
if (session_id() == '') {
|
||||
$cookieParams = session_get_cookie_params();
|
||||
$cookieParams['secure'] = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? true : false);
|
||||
session_set_cookie_params($cookieParams['lifetime'], $cookieParams['path'], $cookieParams['domain'], $cookieParams['secure'], $cookieParams['httponly']);
|
||||
session_name('s9y_' . md5(dirname(__FILE__)));
|
||||
session_start();
|
||||
}
|
||||
|
Reference in New Issue
Block a user