0.2.0 • Published 8 years ago

connect-mysql-store v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

connect-mysql-store

A simple and minimal MySQL session store for Express session

npm version Build Status

Installation

npm install connect-mysql-store

Prerequisite

The database table to save the session data must exist. Following is the expected table schema.

CREATE TABLE sessions (
    sid varchar(255) NOT NULL,
    session varchar(2048) NOT NULL DEFAULT '',
    updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (sid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Usage

See more detailed explanation at Express session.

app.use(session({
  secret: 'super secret!',
  resave: true,
  saveUninitialized: false,
  store: new MySQLStore({
    url: mysql://travis@localhost/connect_mysql_test
  })
}));

Options

  • url: (required). MySQL database connection string.
  • table: (optional). Table name to save the sessions data. By default, name is 'sessions'.

License

MIT License

0.2.0

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago