{"action":"created","issue":{"url":"https://api.github.com/repos/expressjs/session/issues/148","labels_url":"https://api.github.com/repos/expressjs/session/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/expressjs/session/issues/148/comments","events_url":"https://api.github.com/repos/expressjs/session/issues/148/events","html_url":"https://github.com/expressjs/session/issues/148","id":70806205,"number":148,"title":"Trouble upgrading to Express 4 + standalone session middleware...","user":{"login":"rabbitfufu","id":3516664,"avatar_url":"https://avatars.githubusercontent.com/u/3516664?v=3","gravatar_id":"","url":"https://api.github.com/users/rabbitfufu","html_url":"https://github.com/rabbitfufu","followers_url":"https://api.github.com/users/rabbitfufu/followers","following_url":"https://api.github.com/users/rabbitfufu/following{/other_user}","gists_url":"https://api.github.com/users/rabbitfufu/gists{/gist_id}","starred_url":"https://api.github.com/users/rabbitfufu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabbitfufu/subscriptions","organizations_url":"https://api.github.com/users/rabbitfufu/orgs","repos_url":"https://api.github.com/users/rabbitfufu/repos","events_url":"https://api.github.com/users/rabbitfufu/events{/privacy}","received_events_url":"https://api.github.com/users/rabbitfufu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/expressjs/session/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":8,"created_at":"2015-04-24T22:05:41Z","updated_at":"2015-04-25T00:31:43Z","closed_at":null,"body":"Hello,\r\n\r\nI have a question about upgrading from the old session middleware that was bundled with Express 3, and the session middleware intended for use with Express 4...\r\n\r\nHere is the background:  \r\n\r\nI need to support sessions on some devices that do not allow session cookies.  To do this, in Express 3 I would pass the sessionID in the querystring, then manually set the session cookie so express.session could pick it up:\r\n```js\r\napp.use(function getSessionByQuerystring( req, res, next ) {\r\n    if ( req.query.session_id ) req.cookies[ \"connect.sid\" ] = req.query.session_id;\r\n    next();\r\n});\r\n\r\napp.use( express.session({\r\n    secret: \"secret stuff\",\r\n    name: \"connect.sid\",\r\n    cookie: { secure: false },\r\n    store: store\r\n}));\r\n```\r\nThis worked fine. However, now that I have upgraded and am using the standalone session middle-ware, it has stopped working:\r\n```js\r\nvar session = require( \"express-session\" );\r\n\r\napp.use(function getSessionByQuerystring( req, res, next ) {\r\n    if ( req.query.session_id ) req.cookies[ \"connect.sid\" ] = req.query.session_id;\r\n    next();\r\n});\r\n\r\napp.use( session({\r\n    secret: \"secret stuff\",\r\n    name: \"connect.sid\",\r\n    cookie: { secure: false },\r\n    store: store\r\n}));\r\n```\r\nThe session middleware no longer seems able to pick up the session cookie that I am manually setting.\r\n\r\nCan anyone tell me what has changed between the session middleware bundled with Express 3, and the new express-session middleware for use with Express 4, that would cause this to stop working? How can I manually set req.cookies[ \"connect.sid\" ] so that the session middleware will recognize it?  Thanks!"},"comment":{"url":"https://api.github.com/repos/expressjs/session/issues/comments/96108811","html_url":"https://github.com/expressjs/session/issues/148#issuecomment-96108811","issue_url":"https://api.github.com/repos/expressjs/session/issues/148","id":96108811,"user":{"login":"rabbitfufu","id":3516664,"avatar_url":"https://avatars.githubusercontent.com/u/3516664?v=3","gravatar_id":"","url":"https://api.github.com/users/rabbitfufu","html_url":"https://github.com/rabbitfufu","followers_url":"https://api.github.com/users/rabbitfufu/followers","following_url":"https://api.github.com/users/rabbitfufu/following{/other_user}","gists_url":"https://api.github.com/users/rabbitfufu/gists{/gist_id}","starred_url":"https://api.github.com/users/rabbitfufu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabbitfufu/subscriptions","organizations_url":"https://api.github.com/users/rabbitfufu/orgs","repos_url":"https://api.github.com/users/rabbitfufu/repos","events_url":"https://api.github.com/users/rabbitfufu/events{/privacy}","received_events_url":"https://api.github.com/users/rabbitfufu/received_events","type":"User","site_admin":false},"created_at":"2015-04-25T00:31:43Z","updated_at":"2015-04-25T00:31:43Z","body":"Hi Doug.  I'd be happy to put together a sample app that you can reproduce with -- you'll have to forgive me, but I am just learning how to use GitHub -- what is simplest, should I just email it to you as a zip?"}}