summaryrefslogtreecommitdiff
path: root/src/c
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 14:03:50 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 14:03:50 -0500
commitd6dbcd83918e1cc3b6f6bba2f2b8e82bb15a6e7b (patch)
tree9e9881243ec7e26be8817357bfc5aa2ede51802a /src/c
parent24777c2dc9b6ea0f3db24ae372be2af0c3f70602 (diff)
Cookies work across pages
Diffstat (limited to 'src/c')
-rw-r--r--src/c/driver.c2
-rw-r--r--src/c/urweb.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/c/driver.c b/src/c/driver.c
index d884c025..1eef9742 100644
--- a/src/c/driver.c
+++ b/src/c/driver.c
@@ -71,7 +71,7 @@ static int try_rollback(uw_context ctx) {
static void *worker(void *data) {
int me = *(int *)data, retries_left = MAX_RETRIES;
- uw_context ctx = uw_init(1024, 0);
+ uw_context ctx = uw_init(0, 1024, 0);
while (1) {
failure_kind fk = uw_begin_init(ctx);
diff --git a/src/c/urweb.c b/src/c/urweb.c
index cc21c558..638fbb16 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -1152,11 +1152,13 @@ uw_Basis_string uw_Basis_get_cookie(uw_context ctx, uw_Basis_string c) {
}
}
-uw_unit uw_Basis_set_cookie(uw_context ctx, uw_Basis_string c, uw_Basis_string v) {
+uw_unit uw_Basis_set_cookie(uw_context ctx, uw_Basis_string prefix, uw_Basis_string c, uw_Basis_string v) {
uw_write_header(ctx, "Set-Cookie: ");
uw_write_header(ctx, c);
uw_write_header(ctx, "=");
uw_write_header(ctx, v);
+ uw_write_header(ctx, "; path=");
+ uw_write_header(ctx, prefix);
uw_write_header(ctx, "\r\n");
return uw_unit_v;