Skip to content

Commit

Permalink
Merge pull request #25 from rjz/fix/cleanup-readme
Browse files Browse the repository at this point in the history
Drops store example from README (#1)
  • Loading branch information
rjz committed Mar 1, 2017
2 parents cfbb6c3 + b23d42e commit 2fc1e36
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,18 @@ describe('after authenticating session', function () {

```

### Accessing session data
### Accessing cookies

The cookies attached to the session may be retrieved from `session.cookies` at
any time, for instance to inspect the contents of the current session in an
external store.
The cookies attached to the session may be retrieved from `session.cookies`:

```js
it('should set session details correctly', function (done) {
var sessionCookie = _.find(testSession.cookies, function (cookie) {
return cookie.name === connect.sid;
});

memcached.get(sessionCookie.value, function (err, session) {
session.user.name.should.eq('Foobar');
done();
});
var sessionCookie = testSession.cookies.find(function (cookie) {
return cookie.name === connect.sid;
});
```

If you're using

### Request hooks

By default, supertest-session authenticates using session cookies. If your app
Expand Down

0 comments on commit 2fc1e36

Please sign in to comment.