====
composer install eden/session
====
Before using sessions, it's probably a good idea to start the session.
$session = eden('session')->start();
The session returned is an array object and can be used like a normal array.
$session['me'] = array('name' => 'John', 'age' => 31);
$session['you'] = array('name' => 'Jane', 'age' => 28);
$session['him'] = array('name' => 'Jack', 'age' => 35);
foreach($session as $key => $value) {
echo $value['name'];
}
====
Removes all session data
eden('session')->clear();
Returns Eden\Session\Index
====
Returns data
eden('session')->get(string|null $key);
string|null $key
- The key from the session
Returns scalar|null|array
eden('session')->get();
====
Returns session id
eden('session')->getId();
Returns int
====
Removes a session.
eden('session')->remove(*string $name);
*string $name
- session name
Returns Eden\Session\Index
eden('session')->remove('foo');
====
Sets data
eden('session')->set(*array|string $data, mixed $value);
*array|string $data
- The array data to setmixed $value
- If data is a key then this is the value
Returns Eden\Session\Index
eden('session')->set(array('foo' => 'bar'));
====
Sets the session ID
eden('session')->setId(*int $id);
*int $id
- The prescribed session ID to use
Returns int
eden('session')->setId(123);
====
Starts a session
eden('session')->start();
Returns Eden\Session\Index
====
Starts a session
eden('session')->stop();
Returns Eden\Session\Index
====
Contributions to Eden are following the Github work flow. Please read up before contributing.
##Setting up your machine with the Eden repository and your fork
- Fork the repository
- Fire up your local terminal create a new branch from the
v4
branch of your fork with a branch name describing what your changes are. Possible branch name types:- bugfix
- feature
- improvement
- Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")
##Making pull requests
- Please ensure to run
phpunit
before making a pull request. - Push your code to your remote forked version.
- Go back to your forked version on GitHub and submit a pull request.
- An Eden developer will review your code and merge it in when it has been classified as suitable.