{"comment":{"created_at":"2011-10-13T15:44:10Z","body":"Thanks for the contributions.  It will be helpful if you can fork and send me pull request for these rather than just providing the comment.\r\n\r\nLet me know if there is anything I can do to help. \r\n\r\nThanks\r\n\r\nMartin","updated_at":"2011-10-13T15:44:10Z","url":"https://api.github.com/repos/soitgoes/LoveSeat/issues/comments/2396182","id":2396182,"user":{"gravatar_id":"cdc15d9fb844bcd93ddf7c1407483238","avatar_url":"https://secure.gravatar.com/avatar/cdc15d9fb844bcd93ddf7c1407483238?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/soitgoes","id":134262,"login":"soitgoes"}},"action":"created","issue":{"number":14,"created_at":"2011-10-12T14:44:44Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi there,\r\n\r\nI'm not entirely sure if this is down to the way we have our server setup or not, but in order to get cookie authentication to work I had to modify the CouchBase GetSession method,  even after reading the documentation I'm still confused as to why I had to add this, but it seems to work great now...\r\n\r\n(I added the line to include the Authorization header to the web request, it seems to require that and also the form data)\r\n\r\n        public Cookie GetSession()\r\n        {\r\n            var authCookie = cookiestore[\"authcookie\"];\r\n\r\n            if (authCookie != null)\r\n                return authCookie;\r\n\r\n            if (string.IsNullOrEmpty(username)) return null;\r\n            var request = new CouchRequest(baseUri + \"_session\");\r\n            request.GetRequest().Headers.Add(\"Authorization:Basic \" + Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(username + \":\" + password)));\r\n            var response = request.Post()\r\n                .Form()\r\n                .Data(\"name=\" + username + \"&password=\" + password)\r\n                .GetResponse();\r\n\r\n            var header = response.Headers.Get(\"Set-Cookie\");\r\n            if (header != null)\r\n            {\r\n                var parts = header.Split(';')[0].Split('=');\r\n                authCookie = new Cookie(parts[0], parts[1]);\r\n                authCookie.Domain = response.Server;\r\n                cookiestore.Add(\"authcookie\", authCookie, TimeSpan.FromMinutes(9));\r\n            }\r\n            return authCookie;\r\n        }","comments":1,"title":"Authentication Issue","updated_at":"2011-10-13T15:44:10Z","url":"https://api.github.com/repos/soitgoes/LoveSeat/issues/14","id":1888027,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"d8313b579797c22c7354f3b88b55d88c","avatar_url":"https://secure.gravatar.com/avatar/d8313b579797c22c7354f3b88b55d88c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/firkinfedup","id":1122645,"login":"firkinfedup"},"html_url":"https://github.com/soitgoes/LoveSeat/issues/14","labels":[],"state":"open"},"legacy":{"issue_id":1888027,"comment_id":2396182}}