Search code examples
couchdbcouchdb-nano

CouchDB error -Malformed AuthSession cookie -- version 2,2


I install couchDB 2.2 and it is running on a remote server (ubuntu) . Now , I have a node application with NPM module NANO instaled on another machine.. However, I get an error when I tried to create a document.

 "Error getting existing document: {"message\": "Malformed AuthSession cookie. Please clear your cookies.\",\n  \"stack\": \"Error: Malformed AuthSession cookie. Please clear your cookies.\\n    at Request._callback (/opt/mobile/sprout/a/node_modules/nano/lib/nano.js:248:15)\\n    at Request.self.callback 


 400,    \"uri\": \"http://172.16.x.x:5984/activity-stream/_design/user-job\"\n  },\n  \"errid\": \"non_200\",\n  \"description\": \"couch returned 400\"\n}",

"Error inserting the new document: Malformed AuthSession cookie. Please clear your cookies."

Can you please let me know how to fix this issue.


Solution

  • You're trying to insert a _design document, to do so, you need to have admin username and password for the database. As far as I remember, one way to do so is modifying URL like:

    http://username:[email protected]:5984/activity-stream/_design/user-job