remove personal cache only on user login/logout

This commit is contained in:
ghost 2022-01-03 00:57:24 +02:00
parent f0e976f81c
commit 5bb859b6d0
2 changed files with 5 additions and 3 deletions

View File

@ -80,7 +80,8 @@ if (isset($_POST) && $_POST) {
$_SESSION['userName'] = $userName;
$_SESSION['userId'] = $userId;
$_memcache->flush();
$_memcache->delete('api.user.profile.' . $userName);
$_memcache->delete('api.user.avatar.' . $userName);
// Redirect
header('Location: ' . PROJECT_HOST, true, 302);

View File

@ -3,9 +3,10 @@
if (isset($_SESSION['userName'])) {
session_destroy();
$_memcache->delete('api.user.profile.' . $_SESSION['userName']);
$_memcache->delete('api.user.avatar.' . $_SESSION['userName']);
$_memcache->flush();
session_destroy();
}
header('Location: ' . PROJECT_HOST, true, 302);