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:
parent
db0f8d5c78
commit
1c623006dc
1 changed files with 3 additions and 7 deletions
10
README.md
10
README.md
|
@ -1413,7 +1413,7 @@ enable :sessions
|
||||||
set :session_store, Rack::Session::Pool
|
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
|
```ruby
|
||||||
set :sessions, :expire_after => 2592000
|
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
|
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
|
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:
|
||||||
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:
|
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
use Rack::Session::Pool, :expire_after => 2592000
|
use Rack::Session::Pool, :expire_after => 2592000
|
||||||
|
|
Loading…
Reference in a new issue