From e62120438891836325329d6aa35c45680121ac2e Mon Sep 17 00:00:00 2001 From: Matt Silverlock Date: Wed, 23 Dec 2015 07:57:00 +0800 Subject: [docs] Added mention of context.ClearHandler as per #59; formatting fixes. --- README.md | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 9f2a2ac..c18798d 100644 --- a/README.md +++ b/README.md @@ -40,33 +40,39 @@ Let's start with an example that shows the sessions API in a nutshell: } ``` -First we initialize a session store calling NewCookieStore() and passing a +First we initialize a session store calling `NewCookieStore()` and passing a secret key used to authenticate the session. Inside the handler, we call -store.Get() to retrieve an existing session or a new one. Then we set some -session values in session.Values, which is a map[interface{}]interface{}. -And finally we call session.Save() to save the session in the response. +`store.Get()` to retrieve an existing session or a new one. Then we set some +session values in session.Values, which is a `map[interface{}]interface{}`. +And finally we call `session.Save()` to save the session in the response. + +Important Note: If you aren't using gorilla/mux, you need to wrap your handlers +with +[`context.ClearHandler`](http://www.gorillatoolkit.org/pkg/context#ClearHandler) +as or else you will leak memory! An easy way to do this is to wrap the top-level +mux when calling http.ListenAndServe: More examples are available [on the Gorilla website](http://www.gorillatoolkit.org/pkg/sessions). ## Store Implementations -Other implementations of the sessions.Store interface: +Other implementations of the `sessions.Store` interface: - * [github.com/starJammer/gorilla-sessions-arangodb](https://github.com/starJammer/gorilla-sessions-arangodb) - ArangoDB - * [github.com/yosssi/boltstore](https://github.com/yosssi/boltstore) - Bolt - * [github.com/srinathgs/couchbasestore](https://github.com/srinathgs/couchbasestore) - Couchbase - * [github.com/denizeren/dynamostore](https://github.com/denizeren/dynamostore) - Dynamodb on AWS - * [github.com/bradleypeabody/gorilla-sessions-memcache](https://github.com/bradleypeabody/gorilla-sessions-memcache) - Memcache - * [github.com/hnakamur/gaesessions](https://github.com/hnakamur/gaesessions) - Memcache on GAE - * [github.com/kidstuff/mongostore](https://github.com/kidstuff/mongostore) - MongoDB - * [github.com/srinathgs/mysqlstore](https://github.com/srinathgs/mysqlstore) - MySQL - * [github.com/antonlindstrom/pgstore](https://github.com/antonlindstrom/pgstore) - PostgreSQL - * [github.com/boj/redistore](https://github.com/boj/redistore) - Redis - * [github.com/boj/rethinkstore](https://github.com/boj/rethinkstore) - RethinkDB - * [github.com/boj/riakstore](https://github.com/boj/riakstore) - Riak - * [github.com/michaeljs1990/sqlitestore](https://github.com/michaeljs1990/sqlitestore) - SQLite +* [github.com/starJammer/gorilla-sessions-arangodb](https://github.com/starJammer/gorilla-sessions-arangodb) - ArangoDB +* [github.com/yosssi/boltstore](https://github.com/yosssi/boltstore) - Bolt +* [github.com/srinathgs/couchbasestore](https://github.com/srinathgs/couchbasestore) - Couchbase +* [github.com/denizeren/dynamostore](https://github.com/denizeren/dynamostore) - Dynamodb on AWS +* [github.com/bradleypeabody/gorilla-sessions-memcache](https://github.com/bradleypeabody/gorilla-sessions-memcache) - Memcache +* [github.com/hnakamur/gaesessions](https://github.com/hnakamur/gaesessions) - Memcache on GAE +* [github.com/kidstuff/mongostore](https://github.com/kidstuff/mongostore) - MongoDB +* [github.com/srinathgs/mysqlstore](https://github.com/srinathgs/mysqlstore) - MySQL +* [github.com/antonlindstrom/pgstore](https://github.com/antonlindstrom/pgstore) - PostgreSQL +* [github.com/boj/redistore](https://github.com/boj/redistore) - Redis +* [github.com/boj/rethinkstore](https://github.com/boj/rethinkstore) - RethinkDB +* [github.com/boj/riakstore](https://github.com/boj/riakstore) - Riak +* [github.com/michaeljs1990/sqlitestore](https://github.com/michaeljs1990/sqlitestore) - SQLite - ## License +## License - BSD licensed. See the LICENSE file for details. +BSD licensed. See the LICENSE file for details. -- cgit v1.2.3