코딩일상

오류해결 Indicate whether to send a cookie in a cross-site request by specifying its SameSit(로그아웃 쿠키 제거) 본문

기록/Troubleshooting

오류해결 Indicate whether to send a cookie in a cross-site request by specifying its SameSit(로그아웃 쿠키 제거)

solutionMan 2022. 7. 13. 14:50
반응형

로그아웃

 

에러 내용

Indicate whether to send a cookie in a cross-site request by specifying its SameSit

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>

 

function sign_out() {
    $.removeCookie('mytoken', {path: '/'});
    alert('로그아웃!')
    window.location.href = "/login"
}
<nav>
    <div class="b">
        <button onclick="sign_out()">로그아웃</button>
        <button onclick="go_posting()">동네정보입력</button>
        <button onclick="go_user()">마이페이지</button>
    </div>
</nav>
반응형
Comments