From 336f6c3e6f6f8b7e5ef9ae3bce749974c813f6f9 Mon Sep 17 00:00:00 2001
From: "Leigh B. Stoller" <stoller@flux.utah.edu>
Date: Tue, 29 Mar 2005 20:21:24 +0000
Subject: [PATCH] Make sure the wikicookie is cleared when logging in so that a
 stale one is not left in the browser. Generally this does not matter, except
 that I often switch between users from the same browser.

---
 www/tbauth.php3 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/www/tbauth.php3 b/www/tbauth.php3
index 7e0185bbf6..ffb0036c61 100644
--- a/www/tbauth.php3
+++ b/www/tbauth.php3
@@ -686,6 +686,17 @@ function DOLOGIN($token, $password, $adminmode = 0) {
 	$timeout = $now + (60 * 60 * 24 * 32);
 	setcookie($TBNAMECOOKIE, $uid, $timeout, "/", $TBAUTHDOMAIN, 0);
 
+	#
+	# Clear the existing Wiki cookie so that there is not an old one
+	# for a different user, sitting in the brower. 
+	# 
+	if ($WIKISUPPORT) {
+	    $flushtime = time() - 1000000;
+	    
+	    setcookie($WIKICOOKIENAME, "", $flushtime, "/",
+		      $TBAUTHDOMAIN, $TBSECURECOOKIES);
+	}
+	
 	#
 	# Set adminoff on new logins, unless user requested to be
 	# logged in as admin (and is an admin of course!). This is
-- 
GitLab