Network
session & cookie
by unkwn98
2021. 4. 8.
client <=> server
๐ช client : web browser์ ๊ฐ์ ์ ๋ณด๋ฅผ ์์ฒญํ๊ณ ์ด์ฉํ๋ ์ฌ์ฉ์
๐ช server: ์ฌ์ฉ์[client]์ ์์ฒญ์ด ๋ค์ด์ค๋ฉด ํ์ํ ์ ๋ณด๋ ํ์ผ์ renderingํด์ฃผ๋ ์ผ์ข
์ ์ ์ฅ์์ญํ
๐ช HTTP: client์ server์ ํต์ ์ ์ฌ์ฉ๋๋ protocol[ํต์ ๊ท์ฝ]
cookie & session
๐ช cookie :
- ํญ์ string => parseInt๋ฅผ ํตํด ์ซ์๊ฐ์ผ๋ก ๋ณํํ ์ ์์
- ์ฌ์ฉ์์ web browser์ ์ผ์์ ์ธ ์ ๋ณด๊ฐ ๋ด๊ฒจ์์ (์ผํ์นดํธ ์ฃผ๋ฌธ/๋ก๊ทธ์ธ ์ ๋ณด๋ฑ)
- web browser์ ๋จ์์๋ ๋ถ์ค๋ฌ๊ธฐ ๊ฐ๋คํ์ฌ 'cookie'๋ผ๋ ์ด๋ฆ์ด ๋ถ์
- cookies are used to identify a user's computer as you use a computer network
- HTTP cookies are used to identify specific users and improve your web browsing experience
๐ช session:
- client์ธก์ ์ ๋ณด๊ฐ ๋จ๋ cookie์ ๋ค๋ฅด๊ฒ server์ธก์ ์ ๋ณด๋ฅผ ์ ์ฅ
- session id: client๋ฅผ ์๋ณํ๋ ๊ต์ id (cookie๋ก ์ ์ฅํ ์ ์์ & web browser๋ฅผ ์ข
๋ฃํ๋ฉด expire)
- ๋ก๊ทธ์ธ์ ๋ณด์ ๊ฐ์ ์ค์ํ ์ ๋ณด๋ cookie๊ฐ ์๋ session์ผ๋ก ์ ์ฅํ๋ ๊ฒ์ด ๋ง์
'Network' ์นดํ
๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋๊ธ