# routil-session

> Session handling for routil

Latest version **0.1.1** (published 2012-07-19) · 0 weekly downloads

## Install

```sh
npm install routil-session
pnpm add routil-session
yarn add routil-session
bun add routil-session
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2012-07-19 |
| First published | 2012-07-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Raynos |
| Maintainers | raynos |

## Links

- npm: https://www.npmjs.com/package/routil-session
- Repository: https://github.com/Raynos/routil-session
- Issues: https://github.com/Raynos/routil-session/issues
- npm.io page: https://npm.io/package/routil-session

## Dependencies (5)

- [ap](https://npm.io/package/ap.md) ~0.1.0
- [routil](https://npm.io/package/routil.md) 0.0.13
- [node-uuid](https://npm.io/package/node-uuid.md) ~1.3.3
- [memory-store](https://npm.io/package/memory-store.md) 0.0.1
- [routil-cookie](https://npm.io/package/routil-cookie.md) 0.0.1

## Recent versions

- 0.1.1 (latest) — 2012-07-19
- 0.1.0 — 2012-07-15
- 0.0.1 — 2012-07-15

## README

# routil-session [![build status][1]][2]

Session handling for routil

## Example

    var Session = require("routil-session")
        , session = Session({
            store: require("mongo-store")({
                collection: require("mongo-col")("sessions")
            })
        })
        , http = require("http")

    http.createServer(handler).listen(8080)

    function handler(req, res) {
        if (req.url === "/create") {
            session.createSession(res, {
                foo: "data!"
            }, endResponseCreate)
        } else if (req.url === "/get") {
            session.getSession(req, returnSessionData)
        } else if (req.url === "/destroy") {
            session.destroySession(req, res, endResponseDelete)
        }

        function endResponseCreate(err) {
            res.end("created!")
        }

        function endResponseDelete(err) {
            res.end("deleted!")
        }

        function returnSessionData(err, data) {
            res.end((data && data.foo) || "no data")
        }
    }

## Installation

`npm install routil-session`

## Tests

`make test`

## Contributors

 - Raynos

## MIT Licenced

  [1]: https://secure.travis-ci.org/Raynos/routil-session.png
  [2]: http://travis-ci.org/Raynos/routil-session

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