diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index aca1aee..8c7619f 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -139,24 +139,37 @@ export default function Login() { // In order to update the selected login type whenever the component renders // useEffect(() => { - // document.cookie.includes("loginType=family") ? "loginfamily" : "loginfull" - - // Set the loginType cookie to remember the user's selection - // document.cookie = "loginType=family; expires=Session; path=/;"; - - // Clear the loginType cookie if the user switches to loginfull + // Clear the loginType cookie if the user switches to loginfull // document.cookie ="loginType=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; // }, []); useLayoutEffect(()=>{ // checks the cookie in order to set the login type before components mounts - if(document.cookie.includes("loginType=family")){ - setLoginType('family') - }else if(document.cookie.includes("loginType=full")){ - setLoginType('full') - }else{ - setLoginType('full') + // if(document.cookie.includes("loginType=family")){ + // setLoginType('family') + // }else if(document.cookie.includes("loginType=full")){ + // setLoginType('full') + // }else{ + // setLoginType('full') + // } + function readCookie(cname) { // checks the cookie in order to set the login type before components mounts + let name = cname + "="; + let decoded_cookie = decodeURIComponent(document.cookie); + let carr = decoded_cookie.split(';'); + for(let i=0; i { setMail("");