Event-Planner / client / src / components / log-out / log-out.js
log-out.js
Raw
import Cookies from "universal-cookie";
var cookies = new Cookies();

export default function Logout() {
    localStorage.removeItem('userInfo')
    localStorage.clear();
    cookies.remove('TOKEN_AND_EMAIL', { path: '/' });
    cookies.remove('TOKEN', { path: '/' });
    console.log(cookies.getAll());
    window.location.href = "/";
}