Skip to content

Commit

Permalink
[feature] Set secure cookies by default is connexion is secure
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Nov 10, 2016
1 parent d310b60 commit a20d6f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,11 @@
# Change Log
Only partial changelog, [commit history](https://framagit.org/Shnoulle/LimeSurvey/commits/2.06_SondagesPro) show all changelog.

## Unreleased

### Feature
- Set secure cookies by default is connexion is secure

## [1.1.0] - 2016-11-10

### Fix
Expand Down
10 changes: 7 additions & 3 deletions application/config/internal.php
Expand Up @@ -47,13 +47,15 @@
),
'request' => array(
'class'=>'LSHttpRequest',
'enableCsrfValidation'=>true, // CSRF protection
'enableCookieValidation'=>false, // Enable to activate cookie protection
'csrfCookie' => array(
'secure' => (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off'), // @see session
),
'noCsrfValidationRoutes'=>array(
'remotecontrol',
'plugins/unsecure',
),

'enableCsrfValidation'=>true, // CSRF protection
'enableCookieValidation'=>false // Enable to activate cookie protection
),
'user' => array(
'class' => 'LSWebUser',
Expand Down Expand Up @@ -87,6 +89,8 @@
'session' => array(
'cookieParams' => array(
'httponly' => true,
// Set secure if needed , some dumb server need || $_SERVER['SERVER_PORT'] == 443 . See @link http://stackoverflow.com/a/2886224/2239406
'secure'=>(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off'),
),
),
'messages' => array(
Expand Down

0 comments on commit a20d6f7

Please sign in to comment.