summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnno Boland (tox) <tox@s01.de>2010-03-25 09:59:30 +0100
committerEnno Boland (tox) <tox@s01.de>2010-03-25 09:59:30 +0100
commita7f2765da47529142d61c369f0cea6a68db4ed20 (patch)
tree093ebb040288cc8a06f77254b1fb02032dffa817
parenta05bcc653e3ee1ae856b3073707ffb5aec13940e (diff)
downloadsurf-a7f2765da47529142d61c369f0cea6a68db4ed20.tar.gz
surf-a7f2765da47529142d61c369f0cea6a68db4ed20.tar.bz2
surf-a7f2765da47529142d61c369f0cea6a68db4ed20.zip
reimplementing cookies. Now we need some file locking.
-rw-r--r--surf.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/surf.c b/surf.c
index a046a5a..0ed831c 100644
--- a/surf.c
+++ b/surf.c
@@ -306,7 +306,11 @@ find(Client *c, const Arg *arg) {
const char *
getcookies(SoupURI *uri) {
- return NULL;
+ const char *c;
+ SoupCookieJar *j = soup_cookie_jar_text_new(cookiefile, TRUE);
+ c = soup_cookie_jar_get_cookies(j, uri, TRUE);
+ g_object_unref(j);
+ return c;
}
const char *
@@ -700,7 +704,15 @@ scroll(Client *c, const Arg *arg) {
void
setcookie(SoupCookie *c) {
-
+ SoupDate *e;
+ SoupCookieJar *j = soup_cookie_jar_text_new(cookiefile, FALSE);
+ c = soup_cookie_copy(c);
+ if(c && c->expires == NULL) {
+ e = soup_date_new_from_time_t(time(NULL) + sessiontime);
+ soup_cookie_set_expires(c, e);
+ }
+ soup_cookie_jar_add_cookie(j, c);
+ g_object_unref(j);
}
void