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 https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin.git

Syncgateway Config File:
{
“log”: [""],
“CORS”: {
“origin”: ["
"],
“loginOrigin”: [""],
“headers”: [“Content-Type”, “Cookie”],
“maxAge”: 1728000
},
“adminInterface”: “10.0.1.213:4985”,
“interface”: “10.0.1.213:4984”,
“databases”: {
“test”: {
“server”: “http://10.0.1.135:8091”,
“bucket”: “test”,
“username”: “test”,
“password”: “test”,
“import_docs”: true
},
“taa_gateway”: {
“server”: “http://10.0.1.135:8091”,
“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) {
console.log(result);
$state.go(‘main.inbox’);
}, 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.

see https://developer.couchbase.com/documentation/mobile/current/references/couchbase-lite/rest-api/index.html#!/server/post_replicate

@jamiltz yes yesterday I have tried like that also but no luch… finally using user/password in url worked for me…
i.e: http://username:password@gateway.com/table
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.