First of all, thank you Dale for your answer. Still, the problem is more complex than I anticipated.

I am using YAWS as web server and it doesn't support proxy, so, I have to use two different ports for the two (CouchDB and YAWS). Methods I have tried: 1. $.ajax() - error: not allowed cross-domain data transfer via JavaScript (both IP and port should match exactly for both origin and target), so, even if correct authentication, no cookie. 2. form action pointing to server_name:5984/_session?next=/path_to_attachment/back.html - error: if the authentication fails (incorrect username/password), the "next" is no longer taken (back.html contains only window.location which redirects back to YAWS), but it goes back if the authentication doesn't fail.

I would appreciate any idea related to how to solve any of these errors. Thank you.

Cheers,
CGS





On 09/27/2011 02:43 PM, Dale Harvey wrote:
With Cookie authentication you send a POST to /_session and its result will
contain a Set-Cookie (given the correct credentials), you dont need any
special javascript around, just send the $_POST during login

Cheers
Dale

On 27 September 2011 09:31, CGS<[email protected]>  wrote:

Hi all,

I have few web applications which each requires login and I am trying to
unify their login procedures. One of the applications is CouchDB (obviously)
and, as far as I noticed, this application uses cookie system to save the
login session. Does anyone know what JavaScript files I should load into the
common login page and what to do to create that cookie?

I know there is an option to transfer the login session via address bar,
but I do not fancy that option too much. That's why I try to create the
cookie and I am trying to "hack" futon, but I would appreciate any help if
any of you managed this before. Thank you.

Cheers,
CGS



Reply via email to