# @awesomeorganization/session-handler

> [ESM] The session handler for Node.js according to rfc6265

Latest version **1.1.0** (published 2021-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @awesomeorganization/session-handler
pnpm add @awesomeorganization/session-handler
yarn add @awesomeorganization/session-handler
bun add @awesomeorganization/session-handler
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-09-24 |
| First published | 2021-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sergeysedoy97 |
| Maintainers | sergey.sedoy.97 |
| Keywords | cookie, http, rfc6265, session, state-management |

## Links

- npm: https://www.npmjs.com/package/@awesomeorganization/session-handler
- Repository: https://github.com/awesomeorganization/session-handler
- Homepage: https://github.com/awesomeorganization/session-handler#readme
- Issues: https://github.com/awesomeorganization/session-handler/issues
- npm.io page: https://npm.io/package/@awesomeorganization/session-handler

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-09-24
- 1.0.2 — 2021-04-27
- 1.0.1 — 2021-04-20
- 1.0.0 — 2021-04-09
- 0.1.0 — 2021-03-26

## README

# session-handler

:boom: [ESM] The session handler for Node.js according to rfc6265

---

![npm](https://img.shields.io/david/awesomeorganization/session-handler)
![npm](https://img.shields.io/npm/v/@awesomeorganization/session-handler)
![npm](https://img.shields.io/npm/dt/@awesomeorganization/session-handler)
![npm](https://img.shields.io/npm/l/@awesomeorganization/session-handler)
![npm](https://img.shields.io/bundlephobia/minzip/@awesomeorganization/session-handler)
![npm](https://img.shields.io/bundlephobia/min/@awesomeorganization/session-handler)

---

## Example

Full example in `/example` folder.

```
import { http } from '@awesomeorganization/servers'
import { sessionHandler } from '@awesomeorganization/session-handler'

const example = async () => {
  const sessionMiddleware = await sessionHandler()
  http({
    listenOptions: {
      host: '127.0.0.1',
      port: 3000,
    },
    async onRequest(request, response) {
      const { sessionId, storage } = await sessionMiddleware.handle({
        request,
        response,
      })
      const counter = storage.get('counter') ?? 0
      storage.set('counter', counter + 1)
      response.end(`Hi ${sessionId}! you have visited this page ${counter} times`)
    },
  })
  // TRY
  // http://127.0.0.1:3000/
}

example()
```

---
_Source: https://npm.io/package/@awesomeorganization/session-handler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
