![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.ca/public_html/public/ |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clear Authentication - Liberté Même En Prison</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 50px auto;
padding: 20px;
background: #f5f5f5;
}
.container {
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.btn {
background: #3b82f6;
color: white;
border: none;
padding: 12px 24px;
border-radius: 6px;
cursor: pointer;
font-size: 16px;
margin: 10px 5px;
}
.btn:hover {
background: #2563eb;
}
.success {
color: #059669;
margin: 10px 0;
}
.info {
background: #eff6ff;
border: 1px solid #bfdbfe;
padding: 15px;
border-radius: 6px;
margin: 20px 0;
}
</style>
</head>
<body>
<div class="container">
<h1>🔧 Connection Troubleshooting</h1>
<div class="info">
<strong>Having connection issues between localhost and network IP?</strong><br>
This tool clears authentication cookies to fix login/WebSocket issues when switching between:
<ul>
<li><strong>localhost:3000</strong> (local computer only)</li>
<li><strong>10.119.255.188:3000</strong> (network access)</li>
</ul>
</div>
<h3>Current Connection:</h3>
<p>URL: <strong id="currentUrl"></strong></p>
<p>Host: <strong id="currentHost"></strong></p>
<p>Type: <strong id="connectionType"></strong></p>
<h3>Actions:</h3>
<button class="btn" onclick="clearAuthCookies()">🧹 Clear Authentication Cookies</button>
<button class="btn" onclick="clearAllCookies()">🗑️ Clear All Cookies</button>
<button class="btn" onclick="goToLocalhost()">🏠 Go to Localhost</button>
<button class="btn" onclick="goToNetworkIP()">🌐 Go to Network IP</button>
<div id="result"></div>
<div class="info" style="margin-top: 30px;">
<h4>When to use this:</h4>
<ul>
<li>Can't login after switching URLs</li>
<li>WebSocket connections not working</li>
<li>Chat not connecting properly</li>
<li>Session appears broken</li>
</ul>
</div>
</div>
<script>
// Display current connection info
document.getElementById('currentUrl').textContent = window.location.href;
document.getElementById('currentHost').textContent = window.location.host;
const hostname = window.location.hostname;
let connectionType = 'Unknown';
if (hostname === 'localhost' || hostname === '127.0.0.1') {
connectionType = 'Localhost (Local Computer Only)';
} else if (hostname.startsWith('10.') || hostname.startsWith('192.') || hostname.startsWith('172.')) {
connectionType = 'Network IP (Accessible from other devices)';
} else {
connectionType = 'External Domain';
}
document.getElementById('connectionType').textContent = connectionType;
function clearAuthCookies() {
// Clear NextAuth cookies
document.cookie = 'next-auth.session-token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
document.cookie = '__Secure-next-auth.session-token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; secure;';
document.cookie = 'next-auth.csrf-token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
document.cookie = '__Host-next-auth.csrf-token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; secure;';
showResult('✅ Authentication cookies cleared! You can now login again.');
}
function clearAllCookies() {
// Clear all cookies
document.cookie.split(";").forEach(function(c) {
document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/");
});
// Clear local storage
localStorage.clear();
sessionStorage.clear();
showResult('✅ All cookies and storage cleared! Fresh start.');
}
function goToLocalhost() {
const newUrl = window.location.href.replace(window.location.host, 'localhost:3000');
window.location.href = newUrl;
}
function goToNetworkIP() {
const newUrl = window.location.href.replace(window.location.host, '10.119.255.188:3000');
window.location.href = newUrl;
}
function showResult(message) {
document.getElementById('result').innerHTML = `<div class="success">${message}</div>`;
}
</script>
</body>
</html>