# flatware-session

> Session Middleware for Flatiron.js.

Latest version **0.1.1** (published 2012-10-11) · 0 weekly downloads

## Install

```sh
npm install flatware-session
pnpm add flatware-session
yarn add flatware-session
bun add flatware-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-10-11 |
| First published | 2012-08-31 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pedro Teixeira |
| Maintainers | pgte |

## Links

- npm: https://www.npmjs.com/package/flatware-session
- npm.io page: https://npm.io/package/flatware-session

## Recent versions

- 0.1.1 (latest) — 2012-10-11
- 0.1.0 — 2012-08-31

## README

# Flatware::Session

Session Middleware for Flatiron.js.

Supports Memory Store and Redis.

## Install

Add "flatware-session" to the dependencies of your `package.json` manifest.

    $ npm install

## Add it to your server:

```javascript
var Session = require('flatware-session');

var server = union.createServer({
  before: [
    Session(),
    // ...
  ]
});
```

## Customize It

Options in the constructor:

```javascript

var Session = require('flatware-session');

Session(sessionCookieName, store);
```
`sessionCookieName` defaults to "sid".

`store` can be `require('flatware-session/memory_store')`, `require('flatware-session/redis_store')` or any other conforming store.

Example using Redis:

```javascript
var Session = require('flatware-session');

var cookieName = 'my-sid';
var storeOptions = {
    timeout: 2 * 60 * 60 // 2 hours
  , pass   : "mypasswordforaccessingredis",
  , prefix : "my-session-key-prefix-in-redis" // defaults to "--session-"
};

var store = require('flatware-session/redis_store')(storeOptions);

var server = union.createServer({
  before: [
    Session(cookieName),
    // ...
  ]
});
```

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