Skip to content

Commit

Permalink
Documentation/licensing updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanjhv committed Apr 25, 2020
1 parent dbb243f commit 3d27cfc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion LICENSE → license.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Bryan Horna
Copyright (c) 2015-2020 Bryan Horna

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 10 additions & 18 deletions README.md → readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ branch in this repository.**
**For the middleware version for Slim Framework 2, please check out the `slim-2`
branch in this repository.**


## Installation

Add this line to `require` block in your `composer.json`:

```
```json
"bryanjhv/slim-session": "~4.0"
```

Expand All @@ -25,7 +24,6 @@ Or, run in a shell instead:
composer require bryanjhv/slim-session:~4.0
```


## Usage

```php
Expand All @@ -37,19 +35,18 @@ $app->add(new \Slim\Middleware\Session([
]));
```


### Supported options

* `lifetime`: How much should the session last? Default `20 minutes`. Any
- `lifetime`: How much should the session last? Default `20 minutes`. Any
argument that `strtotime` can parse is valid.
* `path`, `domain`, `secure`, `httponly`: Options for the session cookie.
* `name`: Name for the session cookie. Defaults to `slim_session` (instead of
- `path`, `domain`, `secure`, `httponly`: Options for the session cookie.
- `name`: Name for the session cookie. Defaults to `slim_session` (instead of
PHP's `PHPSESSID`).
* **`autorefresh`**: `true` if you want session to be refresh when user activity
- **`autorefresh`**: `true` if you want session to be refresh when user activity
is made (interaction with server).
* `handler`: Custom session handler class or object. Must implement
- `handler`: Custom session handler class or object. Must implement
`SessionHandlerInterface` as required by PHP.
* `ini_settings`: Associative array of custom [session configuration][sesscfg].
- `ini_settings`: Associative array of custom [session configuration][sesscfg].
Previous versions of this package had some hardcoded values which could bring
serious performance leaks (see #30):
```php
Expand All @@ -60,7 +57,6 @@ $app->add(new \Slim\Middleware\Session([
]
```


## Session helper

A `Helper` class is available, which you can register globally or instantiate:
Expand Down Expand Up @@ -117,26 +113,22 @@ $app->get('/', function ($req, $res) {
});
```


## Contributors

[Here][contributors] are the big ones listed. :smile:


## TODO

- Complete `Helper` tests. (thanks @Zemistr)
- Slim-specific tests (integration with Slim App).


## License

MIT


[slim]: https://www.slimframework.com/docs/v4/
[sesscfg]: http://php.net/manual/en/session.configuration.php
[sesscfg]: https://www.php.net/manual/en/session.configuration.php
[contributors]: https://github.com/bryanjhv/slim-session/graphs/contributors

[paybtn]: https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif
[paylnk]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DVB7SSMVSHGTN
[paylnk]:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DVB7SSMVSHGTN

0 comments on commit 3d27cfc

Please sign in to comment.