<commit_before>express-socket.io-session
=========================

Share a cookie-based express-session middleware with socket.io

**THIS MODULE WORKS FINE BUT IS EXPERIMENTAL.**

**It works with express > 4.0.0 and socket.io > 1.0.0 and won't be backward compatible.**.

On every socket connection, you'll have `socket.handshake.session` pointing to
the same `req.session` you would expect in any express app handler that uses
the `express-session` middleware module.


## Installation

```
$ npm install express-socket.io-session
```
## Usage

    var session require("express-session")({
        secret: "my-secret",
        resave: true,
        saveUninitialized: true
    });
    // Use sessions with express
    app.use(session);
    //Share the express' session with socket.io
    io.use(require("express-socket.io-session")(session));
<commit_msg>improved readme. added link to create new issue<commit_after>express-socket.io-session
=========================

Share a cookie-based express-session middleware with socket.io

**exxpress-socket.io-session** works with **express > 4.0.0** and **socket.io > 1.0.0** and won't be backward compatible.

**Please help me notice errors or ask me for improvements [creating an issue](https://github.com/oskosk/express-socket.io-session/issues/new)**.

## Overview

On every socket connection, you'll have `socket.handshake.session` pointing to
the same `req.session` you would expect in any express app handler that uses
the `express-session` middleware module.


## Installation

```
$ npm install express-socket.io-session
```
## Usage

    var session require("express-session")({
        secret: "my-secret",
        resave: true,
        saveUninitialized: true
    });
    // Use sessions with express
    app.use(session);
    //Share the express' session with socket.io
    io.use(require("express-socket.io-session")(session));

{'fraction_non_alphanumeric': 0.142932768660667, 'fraction_numerical': 0.006352567496029645, 'mean_word_length': 3.8461538461538463, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1806020', 'n_tokens_mistral': 557, 'n_tokens_neox': 533, 'n_words': 174}