-
세션 유무에 따라 로그인-로그아웃 바뀌게 하려고 했음
-
초기:undefined =>세션 들어온 상태 => 세션 삭제된 후: {}(빈 객체로 남음)
-
세션이 삭제된 후 빈 객체는 undefined나 null로 체크를 할 수가 없음
-
그래서 빈 객체체크하는법 찾아 적용하고 메모중
if(typeof session == "undefined" || JSON.stringify(session) === JSON.stringify({}){
~~~
}else{
~~~
}
length 도 많이 비교합니당
Object.keys(session).length >= 0