{"action":"created","comment":{"url":"https://api.github.com/repos/expressjs/session/pulls/comments/31236702","id":31236702,"diff_hunk":"@@ -43,6 +43,74 @@ exports.Store = Store;\n exports.Cookie = Cookie;\n exports.Session = Session;\n exports.MemoryStore = MemoryStore;\n+exports.sessionId = {\n+  /**\n+   * Set sessionId to cookie.\n+   *\n+   * @private\n+   */\n+  set: function (res, name, sessionId, secret, options) {\n+    var signed = 's:' + signature.sign(sessionId, secret);\n+    var data = cookie.serialize(name, signed, options);\n+\n+    debug('set-cookie %s', data);\n+\n+\n+    var prev = res.getHeader('set-cookie');\n+    var header = [];\n+\n+    if (prev) {\n+      header = header.concat(prev);\n+    }\n+\n+    res.setHeader('set-cookie', header.concat(data))\n+  },\n+\n+  /**\n+   * Get the session ID cookie from request.\n+   *\n+   * @return {string}\n+   * @private\n+   */\n+  get: function (req, name, secrets) {","path":"index.js","position":33,"original_position":33,"commit_id":"470f3348c89db62990cc8f43c0f8adb4234090a6","original_commit_id":"470f3348c89db62990cc8f43c0f8adb4234090a6","user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"body":"Just reference the old `getcookie` function instead of copy and pasting it up here (where it ends up with another level of indentation).","created_at":"2015-05-28T14:12:29Z","updated_at":"2015-05-28T14:12:29Z","html_url":"https://github.com/expressjs/session/pull/164#discussion_r31236702","pull_request_url":"https://api.github.com/repos/expressjs/session/pulls/164","_links":{"self":{"href":"https://api.github.com/repos/expressjs/session/pulls/comments/31236702"},"html":{"href":"https://github.com/expressjs/session/pull/164#discussion_r31236702"},"pull_request":{"href":"https://api.github.com/repos/expressjs/session/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/expressjs/session/pulls/164","id":36405230,"html_url":"https://github.com/expressjs/session/pull/164","diff_url":"https://github.com/expressjs/session/pull/164.diff","patch_url":"https://github.com/expressjs/session/pull/164.patch","issue_url":"https://api.github.com/repos/expressjs/session/issues/164","number":164,"state":"open","locked":false,"title":"Implemented ability to sessionId manually. It fixes #158","user":{"login":"stalniy","id":1159966,"avatar_url":"https://avatars.githubusercontent.com/u/1159966?v=3","gravatar_id":"","url":"https://api.github.com/users/stalniy","html_url":"https://github.com/stalniy","followers_url":"https://api.github.com/users/stalniy/followers","following_url":"https://api.github.com/users/stalniy/following{/other_user}","gists_url":"https://api.github.com/users/stalniy/gists{/gist_id}","starred_url":"https://api.github.com/users/stalniy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stalniy/subscriptions","organizations_url":"https://api.github.com/users/stalniy/orgs","repos_url":"https://api.github.com/users/stalniy/repos","events_url":"https://api.github.com/users/stalniy/events{/privacy}","received_events_url":"https://api.github.com/users/stalniy/received_events","type":"User","site_admin":false},"body":"Exported cookie sessionId store in case if someone wants to check in few places: cookies, headers, query string, etc. Simplified code and added tests","created_at":"2015-05-28T13:18:52Z","updated_at":"2015-05-28T14:12:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ef9c6fb299947c3b68e0ffaebf6909f5d6da49c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/expressjs/session/pulls/164/commits","review_comments_url":"https://api.github.com/repos/expressjs/session/pulls/164/comments","review_comment_url":"https://api.github.com/repos/expressjs/session/pulls/comments{/number}","comments_url":"https://api.github.com/repos/expressjs/session/issues/164/comments","statuses_url":"https://api.github.com/repos/expressjs/session/statuses/470f3348c89db62990cc8f43c0f8adb4234090a6","head":{"label":"stalniy:master","ref":"master","sha":"470f3348c89db62990cc8f43c0f8adb4234090a6","user":{"login":"stalniy","id":1159966,"avatar_url":"https://avatars.githubusercontent.com/u/1159966?v=3","gravatar_id":"","url":"https://api.github.com/users/stalniy","html_url":"https://github.com/stalniy","followers_url":"https://api.github.com/users/stalniy/followers","following_url":"https://api.github.com/users/stalniy/following{/other_user}","gists_url":"https://api.github.com/users/stalniy/gists{/gist_id}","starred_url":"https://api.github.com/users/stalniy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stalniy/subscriptions","organizations_url":"https://api.github.com/users/stalniy/orgs","repos_url":"https://api.github.com/users/stalniy/repos","events_url":"https://api.github.com/users/stalniy/events{/privacy}","received_events_url":"https://api.github.com/users/stalniy/received_events","type":"User","site_admin":false},"repo":{"id":36429907,"name":"session","full_name":"stalniy/session","owner":{"login":"stalniy","id":1159966,"avatar_url":"https://avatars.githubusercontent.com/u/1159966?v=3","gravatar_id":"","url":"https://api.github.com/users/stalniy","html_url":"https://github.com/stalniy","followers_url":"https://api.github.com/users/stalniy/followers","following_url":"https://api.github.com/users/stalniy/following{/other_user}","gists_url":"https://api.github.com/users/stalniy/gists{/gist_id}","starred_url":"https://api.github.com/users/stalniy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stalniy/subscriptions","organizations_url":"https://api.github.com/users/stalniy/orgs","repos_url":"https://api.github.com/users/stalniy/repos","events_url":"https://api.github.com/users/stalniy/events{/privacy}","received_events_url":"https://api.github.com/users/stalniy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stalniy/session","description":"Simple session middleware for Express","fork":true,"url":"https://api.github.com/repos/stalniy/session","forks_url":"https://api.github.com/repos/stalniy/session/forks","keys_url":"https://api.github.com/repos/stalniy/session/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stalniy/session/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stalniy/session/teams","hooks_url":"https://api.github.com/repos/stalniy/session/hooks","issue_events_url":"https://api.github.com/repos/stalniy/session/issues/events{/number}","events_url":"https://api.github.com/repos/stalniy/session/events","assignees_url":"https://api.github.com/repos/stalniy/session/assignees{/user}","branches_url":"https://api.github.com/repos/stalniy/session/branches{/branch}","tags_url":"https://api.github.com/repos/stalniy/session/tags","blobs_url":"https://api.github.com/repos/stalniy/session/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stalniy/session/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stalniy/session/git/refs{/sha}","trees_url":"https://api.github.com/repos/stalniy/session/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stalniy/session/statuses/{sha}","languages_url":"https://api.github.com/repos/stalniy/session/languages","stargazers_url":"https://api.github.com/repos/stalniy/session/stargazers","contributors_url":"https://api.github.com/repos/stalniy/session/contributors","subscribers_url":"https://api.github.com/repos/stalniy/session/subscribers","subscription_url":"https://api.github.com/repos/stalniy/session/subscription","commits_url":"https://api.github.com/repos/stalniy/session/commits{/sha}","git_commits_url":"https://api.github.com/repos/stalniy/session/git/commits{/sha}","comments_url":"https://api.github.com/repos/stalniy/session/comments{/number}","issue_comment_url":"https://api.github.com/repos/stalniy/session/issues/comments{/number}","contents_url":"https://api.github.com/repos/stalniy/session/contents/{+path}","compare_url":"https://api.github.com/repos/stalniy/session/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stalniy/session/merges","archive_url":"https://api.github.com/repos/stalniy/session/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stalniy/session/downloads","issues_url":"https://api.github.com/repos/stalniy/session/issues{/number}","pulls_url":"https://api.github.com/repos/stalniy/session/pulls{/number}","milestones_url":"https://api.github.com/repos/stalniy/session/milestones{/number}","notifications_url":"https://api.github.com/repos/stalniy/session/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stalniy/session/labels{/name}","releases_url":"https://api.github.com/repos/stalniy/session/releases{/id}","created_at":"2015-05-28T10:00:40Z","updated_at":"2015-05-28T10:00:40Z","pushed_at":"2015-05-28T13:17:42Z","git_url":"git://github.com/stalniy/session.git","ssh_url":"git@github.com:stalniy/session.git","clone_url":"https://github.com/stalniy/session.git","svn_url":"https://github.com/stalniy/session","homepage":"","size":1960,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"expressjs:master","ref":"master","sha":"dfdbdbfe7cfb759dba1805bece2024029e3b1508","user":{"login":"expressjs","id":5658226,"avatar_url":"https://avatars.githubusercontent.com/u/5658226?v=3","gravatar_id":"","url":"https://api.github.com/users/expressjs","html_url":"https://github.com/expressjs","followers_url":"https://api.github.com/users/expressjs/followers","following_url":"https://api.github.com/users/expressjs/following{/other_user}","gists_url":"https://api.github.com/users/expressjs/gists{/gist_id}","starred_url":"https://api.github.com/users/expressjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/expressjs/subscriptions","organizations_url":"https://api.github.com/users/expressjs/orgs","repos_url":"https://api.github.com/users/expressjs/repos","events_url":"https://api.github.com/users/expressjs/events{/privacy}","received_events_url":"https://api.github.com/users/expressjs/received_events","type":"Organization","site_admin":false},"repo":{"id":16875250,"name":"session","full_name":"expressjs/session","owner":{"login":"expressjs","id":5658226,"avatar_url":"https://avatars.githubusercontent.com/u/5658226?v=3","gravatar_id":"","url":"https://api.github.com/users/expressjs","html_url":"https://github.com/expressjs","followers_url":"https://api.github.com/users/expressjs/followers","following_url":"https://api.github.com/users/expressjs/following{/other_user}","gists_url":"https://api.github.com/users/expressjs/gists{/gist_id}","starred_url":"https://api.github.com/users/expressjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/expressjs/subscriptions","organizations_url":"https://api.github.com/users/expressjs/orgs","repos_url":"https://api.github.com/users/expressjs/repos","events_url":"https://api.github.com/users/expressjs/events{/privacy}","received_events_url":"https://api.github.com/users/expressjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/expressjs/session","description":"Simple session middleware for Express","fork":false,"url":"https://api.github.com/repos/expressjs/session","forks_url":"https://api.github.com/repos/expressjs/session/forks","keys_url":"https://api.github.com/repos/expressjs/session/keys{/key_id}","collaborators_url":"https://api.github.com/repos/expressjs/session/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/expressjs/session/teams","hooks_url":"https://api.github.com/repos/expressjs/session/hooks","issue_events_url":"https://api.github.com/repos/expressjs/session/issues/events{/number}","events_url":"https://api.github.com/repos/expressjs/session/events","assignees_url":"https://api.github.com/repos/expressjs/session/assignees{/user}","branches_url":"https://api.github.com/repos/expressjs/session/branches{/branch}","tags_url":"https://api.github.com/repos/expressjs/session/tags","blobs_url":"https://api.github.com/repos/expressjs/session/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/expressjs/session/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/expressjs/session/git/refs{/sha}","trees_url":"https://api.github.com/repos/expressjs/session/git/trees{/sha}","statuses_url":"https://api.github.com/repos/expressjs/session/statuses/{sha}","languages_url":"https://api.github.com/repos/expressjs/session/languages","stargazers_url":"https://api.github.com/repos/expressjs/session/stargazers","contributors_url":"https://api.github.com/repos/expressjs/session/contributors","subscribers_url":"https://api.github.com/repos/expressjs/session/subscribers","subscription_url":"https://api.github.com/repos/expressjs/session/subscription","commits_url":"https://api.github.com/repos/expressjs/session/commits{/sha}","git_commits_url":"https://api.github.com/repos/expressjs/session/git/commits{/sha}","comments_url":"https://api.github.com/repos/expressjs/session/comments{/number}","issue_comment_url":"https://api.github.com/repos/expressjs/session/issues/comments{/number}","contents_url":"https://api.github.com/repos/expressjs/session/contents/{+path}","compare_url":"https://api.github.com/repos/expressjs/session/compare/{base}...{head}","merges_url":"https://api.github.com/repos/expressjs/session/merges","archive_url":"https://api.github.com/repos/expressjs/session/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/expressjs/session/downloads","issues_url":"https://api.github.com/repos/expressjs/session/issues{/number}","pulls_url":"https://api.github.com/repos/expressjs/session/pulls{/number}","milestones_url":"https://api.github.com/repos/expressjs/session/milestones{/number}","notifications_url":"https://api.github.com/repos/expressjs/session/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/expressjs/session/labels{/name}","releases_url":"https://api.github.com/repos/expressjs/session/releases{/id}","created_at":"2014-02-16T00:38:44Z","updated_at":"2015-05-28T02:32:41Z","pushed_at":"2015-05-28T13:18:53Z","git_url":"git://github.com/expressjs/session.git","ssh_url":"git@github.com:expressjs/session.git","clone_url":"https://github.com/expressjs/session.git","svn_url":"https://github.com/expressjs/session","homepage":"","size":1960,"stargazers_count":565,"watchers_count":565,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":138,"mirror_url":null,"open_issues_count":20,"forks":138,"open_issues":20,"watchers":565,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/expressjs/session/pulls/164"},"html":{"href":"https://github.com/expressjs/session/pull/164"},"issue":{"href":"https://api.github.com/repos/expressjs/session/issues/164"},"comments":{"href":"https://api.github.com/repos/expressjs/session/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/expressjs/session/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/expressjs/session/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/expressjs/session/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/expressjs/session/statuses/470f3348c89db62990cc8f43c0f8adb4234090a6"}}}}