Hi Constanine,
It seems your code is correct. Which version of CBL Android or Java are you
using? 1.0.3.1, 1.0.4 or master branch? If you still encounter the issue,
please file the ticket from
here, https://github.com/couchbase/couchbase-lite-java-core/issues .
Thanks,
Hideki
setCookie method segnature:
```
/**
* Sets an HTTP cookie for the Replication.
*
* @param name The name of the cookie.
* @param value The value of the cookie.
* @param path The path attribute of the cookie. If null or empty,
will use remote.getPath()
* @param maxAge The maxAge, in milliseconds, that this cookie should
be valid for.
* @param secure Whether the cookie should only be sent using a secure
protocol (e.g. HTTPS).
* @param httpOnly (ignored) Whether the cookie should only be used
when transmitting HTTP, or HTTPS, requests thus restricting access from
other, non-HTTP APIs.
*/
@InterfaceAudience.Public
public void setCookie(String name, String value, String path, long
maxAge, boolean secure, boolean httpOnly);
```
On Monday, February 16, 2015 at 2:05:30 AM UTC-8, Constantine Kozak wrote:
>
>
>
> I want to use Replication with custom auth. As I understand I can get
> sessionId with my own means (app calls my server which POST to
> SyncGateway's _session) and then just set a cookie in Replication and it
> should pass it. I create a replication in a such way:
>
> Replication pullReplication = database.createPullReplication("
>> http://host.com:4984/dbName");
>> pullReplication.setContinuous(true);
>> pullReplication.setCookie("SyncGatewaySession", "<SESSION ID VALUE>", "
>> host.com:4984", expireDate, false, false);
>
>
> and get these:
>
>> 02-16 05:01:07.370 4706-4746/com.phrazr.android.staging
>> E/RemoteRequest﹕ Got error status: 401 for
>> http://host.com:4984/dbName/_local/d07fc6d8daf6751891ac5d806aaf5a6cf2945960.
>> Reason: Unauthorized
>
>
> I checked in a http sniffer - cookies are not sent. The only headers
> present are: Host=host.com:4984, Accept=multipart/related,
> application/json and Connection=Keep-Alive.
>
> Am I using setCookie in a wrong way or it's a bug?
>
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/8c065713-076b-4cc2-914d-07a54ef0d0d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.