summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Silverlock <matt@eatsleeprepeat.net>2015-12-23 03:00:50 +0300
committerMatt Silverlock <matt@eatsleeprepeat.net>2015-12-23 03:00:50 +0300
commit99b16d2edd22458c541b3640ce83689b08a05c20 (patch)
treec88110630848f4ee2914fc493261eb5873d77d15
parentf7261893ca3ea922c30eabe742c036d2c1de6e0a (diff)
parente62120438891836325329d6aa35c45680121ac2e (diff)
Merge pull request #61 from gorilla/readme-notes
[docs] Added mention of context.ClearHandler as per #59
-rw-r--r--README.md46
1 files changed, 26 insertions, 20 deletions
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.