Cordova(Ionic) couchbase-lite pull request not getting records

Am using technologies as (Couchbase-Lite,Ionic and syncgateway) when syncgateway started with guest couchbase-lite able to pull requests but when I disable guest and try to use pull request with custom header as Cookie with Syncgatewaysession id not able to pull requests.

Cordovaplugin Which I am using:
cordova plugin add

Syncgateway Config File:
“log”: [""],
“CORS”: {
“origin”: ["
“loginOrigin”: [""],
“headers”: [“Content-Type”, “Cookie”],
“maxAge”: 1728000
“adminInterface”: “”,
“interface”: “”,
“databases”: {
“test”: {
“server”: “”,
“bucket”: “test”,
“username”: “test”,
“password”: “test”,
“import_docs”: true
“taa_gateway”: {
“server”: “”,
“bucket”: “taa-app”,
“username”: “taa-app”,
“import_docs”: true,
“password”: “taa-app”,
“users”: {
“GUEST”: {
“disabled”: true,
“admin_channels”: ["
“shiva”: {
“disabled”: false,
“password”: “ktree123”,
“admin_channels”: [“admin”, “editor”]
“sync”: function(doc,olddoc){ channel(doc.channels); }

Angular Code:
Session Id I created directly from admin API for testing purpose and using… it has expiry for 2 days more.
var cookie = “SyncGatewaySession=ad33bcf2dafdbbe99bd3e416e9fa84fd8e0d9b82”;
var source = {
“url”: url,
“Cookie”: cookie
couchlite.messages.replicate(source, tableName, {
replication_id: ‘inbox-intial-sync’,
continuous: true
}).then(function(result) {
}, function(error) {
console.error("from live ERROR -> " + JSON.stringify(error));

Any one else facing this kind of issue?

The Cookie key/value should be specified under the headers object.


@jamiltz yes yesterday I have tried like that also but no luch… finally using user/password in url worked for me…
Do I need to create session from app it self or can be created before and use that not crossed expiry time.?
Adding username and password in url is that secure?

@jamiltz: Suddely it started worked look I made some mistake in setting cookie attribute… Thank you very much.