Skip to content

Commit

Permalink
start documenting sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuspoehls committed Jun 14, 2022
1 parent cdd0386 commit d54364a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
Responses: 'responses',
Controllers: 'controllers',
Middleware: 'middleware',
// Session: 'session',
// 'CSRF Protection': 'csrf-protection',
// 'Request Lifecycle': 'request-lifecycle',
// Authentication: 'authentication',
Expand All @@ -52,7 +53,6 @@ module.exports = {
// Encryption: 'encryption',
// Events: 'events',
Logger: 'logger',
// Session: 'session',
// Queues: 'queues'
}
},
Expand Down
18 changes: 16 additions & 2 deletions session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@


## Overview
Tba.
Sessions provide a way to transition HTTP application from being stateless to stateful. Stateful applications save information about users across multiple requests. For example, identifying users across requests is useful in session-based authentication.


## Configuration
Tba.
Your application’s session options are stored in the `config/session.ts` configuration file. This config file allows you to customize the default session driver and driver-specific configuration.

By default, Supercharge uses the `cookie` driver to store session data.


### Available Session Drivers
Supercharge ships with different session backends. All session backends are access in a driver-based approach exposing the same interface. Following the same interface allows you to switch from one session backend to another by changing a single line of configuration:

| Session Driver | Description |
|---------------- |--------------------------------------------- |
| `memory` | Stores session in memory, useful for testing |
| `cookie` | Stores the session data in a cookie |

We welcome every contribution for new session drivers. You can submit a pull request adding a new driver or you may ask for an implementation by creating an issue [in the framework’s GitHub repository](https://github.com/supercharge/framework).



## Interacting with the Session
Expand Down

0 comments on commit d54364a

Please sign in to comment.