codestates / codestates/memory.json

[Error] server에서 client로 쿠키 내용 전송이 안되는 문제

Aperta
#109 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
error
Lingua principale
JavaScript
Stelle
1
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 어떤 에러인가요?
액세스 토큰을 쿠키에 담아 보내려고 하는데 클라이언트에 저장이 안되는 문제

### 에러 메시지

![스크린샷, 2022-05-03 16-01-55](https://user-images.githubusercontent.com/93461412/166415450-9a149dba-7920-4d3b-8455-32a779326e21.png)

### 에러 핸들링 방법
* 핸들링 방법 기록
```
서버는 pem 키 파일이 있어 https로 동작했고 클라이언트는 리액트 http로 동작되었다.

구글 크롬에서 http와 https 프로토콜의 통신간을 same-site로 간주할것인가에 대한 문제였다..
결론적으로는 이제 http와 https 통신은 same-site가 아니다. 따라서 cross-site로 간주하며
쿠키에서 same-site 속성을 주지 않으면 lax값이 기본이기 때문에 서버에 데이터를 바꾸지 않는 get요청에서만
쿠키를 보낼 수 있다.

그러나 우리는 accessToken을 post요청으로 보내야 하기 띠문에 문제가 생긴다.
same-site 속성을 none으로 주면 되지 않느냐 하지만 same-site 속성을 none으로 주면 secure 옵션을 true로 해줘야(https only)
되기 떄문에 지금으로써는 그게 그거이다.

```

### 레퍼런스
[https://blog.jaysiyo.com/2021/schemeful-same-site/](https://blog.jaysiyo.com/2021/schemeful-same-site/)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

No repository file, test, or entry point is named. Start by reading the linked schemeful same-site reference and tracing the server/client cookie setup described in the report; the issue does not define a concrete change or completion criterion.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, react
Ambito
authentication, backend, security
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.