diff --git a/config.def.h b/config.def.h
index b81e6b0..1232a83 100644
--- a/config.def.h
+++ b/config.def.h
@@ -12,6 +12,7 @@ static Bool kioskmode	    = FALSE; /* Ignore shortcuts */
 static Bool showindicators  = TRUE;  /* Show indicators in window title */
 static Bool zoomto96dpi     = TRUE;  /* Zoom pages to always emulate 96dpi */
 static Bool runinfullscreen = FALSE; /* Run in fullscreen mode by default */
+static char cookiepolicy[]  = "Aa";  /* A:always, a:never, @:no third party */
 
 static guint defaultfontsize = 12;   /* Default font size */
 static gfloat zoomlevel = 1.0;       /* Default zoom level */
@@ -93,6 +94,7 @@ static Key keys[] = {
     { MODKEY|GDK_SHIFT_MASK,GDK_s,      toggle,     { .v = "enable-scripts" } },
     { MODKEY|GDK_SHIFT_MASK,GDK_v,      toggle,     { .v = "enable-plugins" } },
     { MODKEY|GDK_SHIFT_MASK,GDK_m,      togglestyle,{ 0 } },
+    { MODKEY|GDK_SHIFT_MASK,GDK_a,      togglecookie,{ 0 } },
     { MODKEY|GDK_SHIFT_MASK,GDK_b,      togglescrollbars,{ 0 } },
     { MODKEY|GDK_SHIFT_MASK,GDK_g,      togglegeolocation, { 0 } },
 };
diff --git a/surf.1 b/surf.1
index 325e817..e5c6f71 100644
--- a/surf.1
+++ b/surf.1
@@ -18,13 +18,18 @@ which makes it possible to embed it in another application. Furthermore,
 one can point surf to another URI by setting its XProperties.
 .SH OPTIONS
 .TP
+.B \-a policies
+Specify the cookie
+.I policies
+to use
+.TP
 .B \-b
 Disable Scrollbars
 .TP
 .B \-B
 Enable Scrollbars
 .TP
-.B \-c cookiefile 
+.B \-c cookiefile
 Specify the
 .I cookiefile
 to use.
@@ -69,7 +74,7 @@ Disable Plugins
 .B \-P
 Enable Plugins
 .TP
-.B \-r scriptfile 
+.B \-r scriptfile
 Specify the user
 .I scriptfile.
 .TP
@@ -83,7 +88,7 @@ Enable Javascript
 Specify the user
 .I stylefile.
 .TP
-.B \-u useragent 
+.B \-u useragent
 Specify the
 .I useragent
 which surf should use.
@@ -94,7 +99,7 @@ Prints version information to standard output, then exits.
 .B \-x
 Prints xid to standard output. This can be used to script the browser by using
 .TP
-.B \-z zoomlevel 
+.B \-z zoomlevel
 Specify the
 .I zoomlevel
 which surf should use.
@@ -177,7 +182,7 @@ Toggle auto-loading of images.
 .TP
 .B Ctrl\-Shift\-m
 Toggle if the
-.I stylefile 
+.I stylefile
 file should be loaded.
 .TP
 .B Ctrl\-Shift\-o
diff --git a/surf.c b/surf.c
index f0be24b..b72f972 100644
--- a/surf.c
+++ b/surf.c
@@ -79,7 +79,7 @@ static gboolean showxid = FALSE;
 static char winid[64];
 static gboolean usingproxy = 0;
 static char togglestat[7];
-static char pagestat[3];
+static char pagestat[4];
 
 static void addaccelgroup(Client *c);
 static void beforerequest(WebKitWebView *w, WebKitWebFrame *f,
@@ -94,9 +94,12 @@ static void clipboard(Client *c, const Arg *arg);
 static void cookiejar_changed(SoupCookieJar *self, SoupCookie *old_cookie,
 		SoupCookie *new_cookie);
 static void cookiejar_finalize(GObject *self);
-static SoupCookieJar *cookiejar_new(const char *filename, gboolean read_only);
+static SoupCookieJar *cookiejar_new(const char *filename, gboolean read_only,
+		SoupCookieJarAcceptPolicy policy);
 static void cookiejar_set_property(GObject *self, guint prop_id,
 		const GValue *value, GParamSpec *pspec);
+static SoupCookieJarAcceptPolicy cookiepolicy_get(const char *p);
+static char cookiepolicy_set(const SoupCookieJarAcceptPolicy p);
 
 static char *copystr(char **str, const char *src);
 static WebKitWebView *createwindow(WebKitWebView *v, WebKitWebFrame *f,
@@ -164,6 +167,7 @@ static void toggle(Client *c, const Arg *arg);
 static void togglegeolocation(Client *c, const Arg *arg);
 static void togglescrollbars(Client *c, const Arg *arg);
 static void togglestyle(Client *c, const Arg *arg);
+static void togglecookie(Client *c, const Arg *arg);
 static void updatetitle(Client *c);
 static void updatewinid(Client *c);
 static void usage(void);
@@ -295,10 +299,12 @@ cookiejar_init(CookieJar *self) {
 }
 
 static SoupCookieJar *
-cookiejar_new(const char *filename, gboolean read_only) {
+cookiejar_new(const char *filename, gboolean read_only,
+		SoupCookieJarAcceptPolicy policy) {
 	return g_object_new(COOKIEJAR_TYPE,
 	                    SOUP_COOKIE_JAR_TEXT_FILENAME, filename,
-	                    SOUP_COOKIE_JAR_READ_ONLY, read_only, NULL);
+	                    SOUP_COOKIE_JAR_READ_ONLY, read_only,
+	                    SOUP_COOKIE_JAR_ACCEPT_POLICY, policy, NULL);
 }
 
 static void
@@ -310,6 +316,47 @@ cookiejar_set_property(GObject *self, guint prop_id, const GValue *value,
 	flock(COOKIEJAR(self)->lock, LOCK_UN);
 }
 
+static SoupCookieJarAcceptPolicy
+cookiepolicy_get(const char *p) {
+	SoupCookieJarAcceptPolicy ep;
+
+	switch (*p) {
+		case 'A':
+			ep = SOUP_COOKIE_JAR_ACCEPT_ALWAYS;
+			break;
+		case 'a':
+			ep = SOUP_COOKIE_JAR_ACCEPT_NEVER;
+			break;
+		case '@':
+			ep = SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
+			break;
+		default:
+			ep = SOUP_COOKIE_JAR_ACCEPT_ALWAYS;
+	}
+	return ep;
+}
+
+static char
+cookiepolicy_set(const SoupCookieJarAcceptPolicy ep) {
+	char p;
+
+	switch (ep) {
+		case SOUP_COOKIE_JAR_ACCEPT_ALWAYS:
+			p = 'A';
+			break;
+		case SOUP_COOKIE_JAR_ACCEPT_NEVER:
+			p = 'a';
+			break;
+		case SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY:
+			p = '@';
+			break;
+		default:
+			p = 'A';
+			break;
+	}
+	return p;
+}
+
 static void
 evalscript(JSContextRef js, char *script, char* scriptname) {
 	JSStringRef jsscript, jsscriptname;
@@ -1066,8 +1113,8 @@ setup(void) {
 
 	/* cookie jar */
 	soup_session_add_feature(s,
-			SOUP_SESSION_FEATURE(cookiejar_new(cookiefile,
-					FALSE)));
+			SOUP_SESSION_FEATURE(cookiejar_new(cookiefile, FALSE,
+					cookiepolicy_get(cookiepolicy))));
 
 	/* ssl */
 	g_object_set(G_OBJECT(s), "ssl-ca-file", cafile, NULL);
@@ -1208,6 +1255,34 @@ togglestyle(Client *c, const Arg *arg) {
 }
 
 static void
+togglecookie(Client *c, const Arg *arg) {
+	SoupCookieJar *jar;
+	SoupCookieJarAcceptPolicy policy;
+	Arg a = { .b = FALSE };
+
+	jar = SOUP_COOKIE_JAR(soup_session_get_feature(webkit_get_default_session(),
+				SOUP_TYPE_COOKIE_JAR));
+	g_object_get(G_OBJECT(jar), "accept-policy", &policy, NULL);
+
+fprintf(stderr, "cookiepolicy:\t%s\n", cookiepolicy);
+fprintf(stderr, "old policy:\t%c\n", cookiepolicy_set(policy));
+
+	if (policy == cookiepolicy_get(cookiepolicy)) {
+		cookiepolicy[0] = cookiepolicy[1];
+		cookiepolicy[1] = cookiepolicy_set(policy);
+	}
+	g_object_set(G_OBJECT(jar), "accept-policy",
+			cookiepolicy_get(cookiepolicy), NULL);
+
+fprintf(stderr, "cookiepolicy:\t%s\n", cookiepolicy);
+	g_object_get(G_OBJECT(jar), "accept-policy", &policy, NULL);
+fprintf(stderr, "new policy:\t%c\n\n", cookiepolicy_set(policy), NULL);
+
+	updatetitle(c);
+	reload(c, &a);
+}
+
+static void
 gettogglestat(Client *c){
 	gboolean value;
 	char *uri;
@@ -1238,14 +1313,14 @@ static void
 getpagestat(Client *c) {
 	const char *uri = geturi(c);
 
+	pagestat[0] = cookiepolicy_set(cookiepolicy_get(cookiepolicy));
 	if(strstr(uri, "https://") == uri) {
-		pagestat[0] = c->sslfailed ? 'U' : 'T';
+		pagestat[1] = c->sslfailed ? 'U' : 'T';
 	} else {
-		pagestat[0] = '-';
+		pagestat[1] = '-';
 	}
-
-	pagestat[1] = usingproxy ? 'P' : '-';
-	pagestat[2] = '\0';
+	pagestat[2] = usingproxy ? 'P' : '-';
+	pagestat[3] = '\0';
 
 }
 
@@ -1284,9 +1359,9 @@ updatewinid(Client *c) {
 static void
 usage(void) {
 	die("usage: %s [-bBfFgGiIkKnNpPsSvx]"
-		" [-c cookiefile] [-e xid] [-r scriptfile]"
-		" [-t stylefile] [-u useragent] [-z zoomlevel]"
-		" [uri]\n", basename(argv0));
+		" [-a cookiepolicy] [-c cookiefile] [-e xid]"
+		" [-r scriptfile] [-t stylefile] [-u useragent]"
+		" [-z zoomlevel] [uri]\n", basename(argv0));
 }
 
 static void
@@ -1319,6 +1394,9 @@ main(int argc, char *argv[]) {
 
 	/* command line args */
 	ARGBEGIN {
+	case 'a':
+		g_strlcpy(cookiepolicy, EARGF(usage()), sizeof(cookiepolicy));
+		break;
 	case 'b':
 		enablescrollbars = 0;
 		break;
