Android Client side:
2 Databases and corresponding push and pull replications started and set cookie is set.
2 databases have different sessions.
Custom Digest auth is followed and 2 cookies for two different database are sent to client. Cookie names remain same i,e SyncGatewaySession but values different.
1)Replications of DB1 is created,set cookie set and started.
2)Replications of DB2 is created,set cookie set and started.
The only DB2 replication is sending cookie to to server not the DB1 replication.Hence 401 for DB1 replication.
To be precise only cookie which is sent last is hold by httpcookiefactory.
Is the cookie same name the issue here? can we get the custom cookie name from Syncgateway?
Need more insight on the design and the usage/generation for cookie.