Klacke, thanks for your reply.

I got it working with Steve Vinoski's help.  As it turns out, I was using set_cookie/3 incorrectly.  Looking at the examples on the yaws website, I was under the impression that I just have to call the set_cookie function, and Yaws would automatically insert the resulting cookie tuple into my out/1 return value, so my erroneous code looks like this:

yaws_api:set_cookie ("foo", "bar", []),
[{status, 200}, {content, "text/html", Body}].

By changing code to this:

C = yaws_api:set_cookie ("foo", "bar", []),
[{status, 200}, {content, "text/html", Body}, C].

everything worked.


On Tue, Nov 12, 2013 at 1:50 AM, Claes Wikstrom <klacke@hyber.org> wrote:
On 10/11/13 19:39, Patrick Moy wrote:
> I can't get cookies to set in Chrome or Firefox running on localhost or
> any other computer on my LAN.  I'm trying to set the cookie using code
> in an <erl> block in the requested .yaws page.  I've tried using the
> newer set_cookie/3 function

Hmmm, works for me is a really boring answer. I know.
Maybe try to run wireshark and see what get's sent on the wire.

Or turn on trace for yaws.

$ yaws -i --tracehttp --traceout

When running in embedded mode, I think these will be turned on
if you give

-yaws trace traffic -yaws trace http

as args to _your_ app

> None of the above, or other combinations I tried worked.  I'm actually
> running Yaws in embedded mode using something similar to the ybed.erl
> example from the Yaws website; do I need to do anything specific in the
> SconfList record for this to work.  At this point, I'm just randomly
> guessing.  Does anyone know how I can get this to work?

sconf settings, ... don't think so. Don't think that any of those
settings should effect cookie settings

Setting the sconfd, gconfs right is not so easy. One option I use
when debugging this is the

yaws --running-config

which can be used to reverse engineer these settings



November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
Erlyaws-list mailing list