Skip to content

Commit

Permalink
Use generic session name and __Host- prefix for improved security
Browse files Browse the repository at this point in the history
  • Loading branch information
hannob committed Mar 11, 2024
1 parent dc16c0d commit bf71551
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

$config['mime_type'] = 'text/html';

$config['session_name'] = 'CONFIG_SCHOKOKEKS_ORG';
$config['theme'] = 'default';

ini_set('display_errors', 'On');
5 changes: 4 additions & 1 deletion session/start.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@

require_once('inc/base.php');

session_name(config('session_name'));
// __Host- prefix guarantees secure cookie that cannot be
// overwritten by other hosts:
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis
session_name('__Host-CONFIG_INTERFACE');

session_set_cookie_params(['path' => '/', 'secure' => true,
'httponly' => true, 'samesite' => 'Lax', ]);
Expand Down

0 comments on commit bf71551

Please sign in to comment.