Problem
Client에서 Server로 http request를 날렸을 때,
Server측에서 쿠키를 설정해주었지만, Client측에 쿠키가 설정이 안되어있음.
Cause
Client에서 http request를 할 때(fetch, axios) 쿠키를 주고 받으려면 옵션이 필요함.
solution
// using axios
axios
.post('endpoint',
body,
{ withCredentials: true }
)
// using fetch
fetch('endpoint', {
method: 'POST',
body: $body,
credentials: 'include'
})
Problem
Client에서 Server로 http request를 날렸을 때,
Server측에서 쿠키를 설정해주었고, 브라우저에서 쿠키가 존재하는 걸로 확인되지만,
document.cookie로 쿠키 값에 접근이 불가능함.
Cause
Server에서 쿠키를 보내줄 때, httpOnly를 설정하면 클라이언트측에서 javascript를 이용하여 접근이 불가능함.
show variables like 'c%';
status
vi
편집기를 이용해 /etc/mysql/my.cnf
파일에 추가
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
설정 후 재시작
sudo service mysql restart