diff --git a/AUTHORS b/AUTHORS
index bd0becf..c600fdd 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -55,5 +55,5 @@ reporting bugs, providing fixes, suggesting useful features or other:
 	Ricardo Martin Camarero <https://github.com/rickyepoderi>
 	Filip Vujicic <https://github.com/FilipVujicic>
 	Janusz Ulanowski <https://github.com/janul>
-	AIMOTO Norihito
-
+	Aimoto Norihito <https://github.com/oss-aimoto>
+	Andy Lindeman <https://github.com/alindeman>
diff --git a/ChangeLog b/ChangeLog
index 266f194..df4d3f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 10/03/2019
 - improve validation of the post-logout URL parameter on logout; thanks AIMOTO Norihito; closes #449
 - release 2.4.0.3
+- clear any existing chunked cookies when setting a non-chunked cookie; prevents login loops in some scenarios
 
 08/28/2019
 - fixes #447 #441 : changed storing POST params from localStorage to
diff --git a/debian/changelog b/debian/changelog
index 73d5526..3087f0d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libapache2-mod-auth-openidc (2.4.0.3+git20191003.6a965b1-1) UNRELEASED; urgency=medium
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Fri, 18 Oct 2019 07:30:07 +0000
+
 libapache2-mod-auth-openidc (2.4.0.3-1) unstable; urgency=high
 
   * Update watch file to use Github tag archives
diff --git a/debian/patches/fix-parallel-build.patch b/debian/patches/fix-parallel-build.patch
index 23205fe..307c9c9 100644
--- a/debian/patches/fix-parallel-build.patch
+++ b/debian/patches/fix-parallel-build.patch
@@ -12,10 +12,10 @@ written.
  Makefile.in | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
 
-diff --git a/Makefile.in b/Makefile.in
-index 64656c8..31cac09 100644
---- a/Makefile.in
-+++ b/Makefile.in
+Index: libapache2-mod-auth-openidc/Makefile.in
+===================================================================
+--- libapache2-mod-auth-openidc.orig/Makefile.in
++++ libapache2-mod-auth-openidc/Makefile.in
 @@ -74,7 +74,9 @@ configure:	configure.ac
  test/test test/test-cmd: test/test.c test/test-cmd.c test/stub.c src/mod_auth_openidc.la
  	@APXS2@ @APXS2_OPTS@ -Wc,"-DNAMEVER=\"@NAMEVER@\" $(CFLAGS)" -Wl,"$(LIBS)" -Isrc -Wc,-Wall -Wc,-g -c -o $@ $@.c test/stub.c $(SRC:.c=.lo) @APR_LIBS@
diff --git a/src/util.c b/src/util.c
index 617136e..41a1929 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1096,6 +1096,23 @@ char *oidc_util_get_chunked_cookie(request_rec *r, const char *cookieName,
 	return cookieValue;
 }
 
+/*
+ * unset all chunked cookies, including the counter cookie, if they exist
+ */
+static void oidc_util_clear_chunked_cookie(request_rec *r,
+		const char *cookieName, apr_time_t expires, const char *ext) {
+	int i = 0;
+	int chunkCount = oidc_util_get_chunked_count(r, cookieName);
+	if (chunkCount > 0) {
+		for (i = 0; i < chunkCount; i++)
+			oidc_util_set_cookie(r,
+					oidc_util_get_chunk_cookie_name(r, cookieName, i), "",
+					expires, ext);
+		oidc_util_set_cookie(r, oidc_util_get_chunk_count_name(r, cookieName),
+				"", expires, ext);
+	}
+}
+
 /*
  * set a cookie value that is split over a number of chunked cookies
  */
@@ -1104,28 +1121,20 @@ void oidc_util_set_chunked_cookie(request_rec *r, const char *cookieName,
 		const char *ext) {
 	int i = 0;
 	int cookieLength = strlen(cookieValue);
-	char *chunkCountName = oidc_util_get_chunk_count_name(r, cookieName);
 	char *chunkValue = NULL;
 
 	/* see if we need to chunk at all */
 	if ((chunkSize == 0)
 			|| ((cookieLength > 0) && (cookieLength < chunkSize))) {
 		oidc_util_set_cookie(r, cookieName, cookieValue, expires, ext);
+		oidc_util_clear_chunked_cookie(r, cookieName, expires, ext);
 		return;
 	}
 
 	/* see if we need to clear a possibly chunked cookie */
 	if (cookieLength == 0) {
-		int chunkCount = oidc_util_get_chunked_count(r, cookieName);
-		if (chunkCount > 0) {
-			for (i = 0; i < chunkCount; i++)
-				oidc_util_set_cookie(r,
-						oidc_util_get_chunk_cookie_name(r, cookieName, i), "",
-						expires, ext);
-			oidc_util_set_cookie(r, chunkCountName, "", expires, ext);
-		} else {
-			oidc_util_set_cookie(r, cookieName, "", expires, ext);
-		}
+		oidc_util_set_cookie(r, cookieName, "", expires, ext);
+		oidc_util_clear_chunked_cookie(r, cookieName, expires, ext);
 		return;
 	}
 
@@ -1139,8 +1148,9 @@ void oidc_util_set_chunked_cookie(request_rec *r, const char *cookieName,
 				oidc_util_get_chunk_cookie_name(r, cookieName, i), chunkValue,
 				expires, ext);
 	};
-	oidc_util_set_cookie(r, chunkCountName,
+	oidc_util_set_cookie(r, oidc_util_get_chunk_count_name(r, cookieName),
 			apr_psprintf(r->pool, "%d", chunkCountValue), expires, ext);
+	oidc_util_set_cookie(r, cookieName, "", expires, ext);
 }
 
 /*