1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Update sessions documentation in readme

This commit is contained in:
Jordan Owens 2016-08-04 22:38:34 -04:00
parent db0f8d5c78
commit 1c623006dc

View file

@ -1413,7 +1413,7 @@ enable :sessions
set :session_store, Rack::Session::Pool
```
Or to enable sessions with a hash of options:
Or to set up sessions with a hash of options:
```ruby
set :sessions, :expire_after => 2592000
@ -1421,13 +1421,9 @@ set :session_store, Rack::Session::Pool
```
Another option is to **not** call `enable :sessions`, but instead pull in your
middleware of choice as you would any other middleware:
middleware of choice as you would any other middleware.
```ruby
use Rack::Session::Pool, :expire_after => 2592000
```
It is important to note that when using this method, session based protection (see 'Configuring attack protection') will not be enabled by default. The Rack middleware to do that will also need to be added:
It is important to note that when using this method, session based protection (see 'Configuring attack protection') **will not be enabled by default**. The Rack middleware to do that will also need to be added:
```ruby
use Rack::Session::Pool, :expire_after => 2592000