Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akrabat/akrabatsession
A ZF2 module for configuring a session
https://github.com/akrabat/akrabatsession
Last synced: 2 months ago
JSON representation
A ZF2 module for configuring a session
- Host: GitHub
- URL: https://github.com/akrabat/akrabatsession
- Owner: akrabat
- Created: 2012-11-10T11:01:58.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2016-11-13T12:10:30.000Z (about 8 years ago)
- Last Synced: 2024-11-01T08:42:18.782Z (2 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 12
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#AkrabatSession
This ZF2 module is intended to make it simple to change the settings of a
session; specifically the most common change required is to set a name for
the cookie used to hold the session id.##Installation
You have a number of choices for installing `AkrabatSession`:
### with Composer
Add `"akrabat/akrabat-session": "dev-master"` to your `composer.json` file and run `php composer.phar update`.
### as a Git Submodule
Clone this project into your `./vendor/` directory:
git submodule add git://github.com/akrabat/AkrabatSession.git vendor/AkrabatSession
You can also just clone the module into your `./vendor/` directory or download it via the 'Zip' button on github.
## Configuration
Once you have installed AkrabatSession, you need to enable it by editing
`config/application.config.php` and adding `AkrabatSession` to the `modules`
section.To configure the session as you required, add the following to your
`config/autoload/global.php` file:'session' => array(
'name' => 'MY_SESSION_NAME_HERE',
),Add additional configuration keys as needed.
### Available configuration keys
The available configuration options are in the `Zend\Session\Config\SessionConfig`
and `Zend\Session\Config\StandardConfig` classes. Most map to the PHP level
[session directives](http://www.php.net/manual/en/session.configuration.php)Some of the more useful ones are:
* `name` - Name of the session
* `remember_me_seconds` - Number of seconds to make session sticky, when rememberMe() is called. Default is 2 weeks (1209600 seconds)
* `save_path` - By default, the path where the session files are created
* `cookie_httponly` - Marks the cookie as accessible only through the HTTP protocol.
* `use_only_cookies` - Specifies that only cookies are used and not session ids in URLs
* `cookie_secure` - Specifies that cookies should only be sent over secure connectionsNote: `AkrabatSession` sets the `cookie_httponly` and `use_only_cookies` settings to true
## Session storage and save handler classes
If you need to set the SessionMangers's storage or save handler class, then
simply create a ServiceManager alias of `session_storage` or `session_save_handler`.