Skip to content

Commit

Permalink
Fix #952 hypenize the session name
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviocopes committed Jul 22, 2016
1 parent e13ded1 commit a40c61a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Improved `authorize` Twig extension to accept a nested array of authorizations [#948](https://github.com/getgrav/grav/issues/948)
1. [](#bugfix)
* Fixed `Folder::delete` method to recursively remove files and folders and causing Upgrade to fail.
* Fix [#952](https://github.com/getgrav/grav/issues/952) hypenize the session name.

# v1.1.1
## 07/16/2016
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function init()
$httponly = $config->get('system.session.httponly', true);

$unique_identifier = GRAV_ROOT;
$this->setName($config->get('system.session.name', 'grav_site') . '-' . substr(md5($unique_identifier), 0, 7) . ($is_admin ? '-admin' : ''));
$this->setName(str_replace(' ', '-', $config->get('system.session.name', 'grav_site')) . '-' . substr(md5($unique_identifier), 0, 7) . ($is_admin ? '-admin' : ''));
$this->start();
setcookie(session_name(), session_id(), time() + $session_timeout, $session_path, $domain, $secure, $httponly);
}
Expand Down

2 comments on commit a40c61a

@rhukster
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should use inflector::hyphenize

@flaviocopes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely! ab17fb2

Please sign in to comment.