diff options
author | Thomas Menari <spaceinvader@chaotika.org> | 2009-06-07 21:25:22 +0200 |
---|---|---|
committer | Simon Rozet <simon@rozet.name> | 2009-06-07 21:27:09 +0200 |
commit | c5144c040f554f0320c744cb48a2d8dc1b646c4e (patch) | |
tree | 7759f9d8ec14b0fc7530ac3e1efd317b2ba1616e /surf.c | |
parent | ffd50068b335bea02a3f477396e9cfe6f906e648 (diff) | |
download | surf-c5144c040f554f0320c744cb48a2d8dc1b646c4e.tar.gz surf-c5144c040f554f0320c744cb48a2d8dc1b646c4e.tar.bz2 surf-c5144c040f554f0320c744cb48a2d8dc1b646c4e.zip |
cookie persistance
* stored in ~/.surf-cookies
* $EDITOR editable
Diffstat (limited to 'surf.c')
-rw-r--r-- | surf.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -26,6 +26,7 @@ typedef struct Client { gint progress; struct Client *next; } Client; +SoupCookieJar *cookiejar; Client *clients = NULL; gboolean embed = FALSE; gboolean showxid = FALSE; @@ -429,8 +430,10 @@ updatetitle(Client *c) { int main(int argc, char *argv[]) { gchar *uri = NULL, *file = NULL; + SoupSession *s; Client *c; int o; + const gchar *home, *filename; gtk_init(NULL, NULL); if (!g_thread_supported()) @@ -472,6 +475,14 @@ int main(int argc, char *argv[]) { goto argerr; if(!clients) newclient(); + + /* cookie persistance */ + s = webkit_get_default_session(); + home = g_get_home_dir(); + filename = g_build_filename(home, ".surf-cookies", NULL); + cookiejar = soup_cookie_jar_text_new(filename, FALSE); + soup_session_add_feature(s, SOUP_SESSION_FEATURE(cookiejar)); + gtk_main(); cleanup(); return EXIT_SUCCESS; |