๋ค์์ ์์
๋๋ค.
{"a":"1","b":"2"}์ ๊ฐ์ด ๋ ๊ฐ ์ด์์ ํค๋ฅผ ์ ๋ฌํด์ผ ํ๋ ๊ฒฝ์ฐ
๋ค์๊ณผ ๊ฐ์ด ์ฝ๋ฉํ๋ฉด :
var ์ฟ ํค = request.cookie('a=1;b=2');
์์ฒญ ์ ๋ ๋ฒ์งธ ํค๊ฐ ์์ค๋ ์ ์์์ ์ ์ ์์ต๋๋ค.
๊ทธ๊ฒ์ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ?
์ ๋ ๊ฐ์ ๋ฌธ์ ์ธ๋ฐ ํด๊ฒฐํ์ จ๋์?
cookie = 'a=1;b=2'
cookie.split(';').forEach((x) => {
jar.setCookie(request.cookie(x), 'https://vtop.vit.ac.in/student/stud_login_submit.asp')
})
์ด๊ฒ์ด ์์ธํ ์๋ฅผ ํ์ธํ๊ธฐ ์ํด ์ฌ๋ฌ ์ฟ ํค๋ฅผ ์ถ๊ฐํ ๋ฐฉ๋ฒ์
๋๋ค.
(https://github.com/sch00lb0y/Vit-Photo/blob/master/scripts/lib.js)
์ด ๋ฌธ์ ๋ ์ต๊ทผ ํ๋์ด ์์๊ธฐ ๋๋ฌธ์ ์๋์ผ๋ก ์ค๋๋ ๊ฒ์ผ๋ก ํ์๋์์ต๋๋ค. ๋ ์ด์ ํ๋์ด ์์ผ๋ฉด ํ์๋ฉ๋๋ค. ๊ทํ์ ๊ธฐ์ฌ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด๊ฒ์ด ์์ธํ ์๋ฅผ ํ์ธํ๊ธฐ ์ํด ์ฌ๋ฌ ์ฟ ํค๋ฅผ ์ถ๊ฐํ ๋ฐฉ๋ฒ์ ๋๋ค.
(https://github.com/sch00lb0y/Vit-Photo/blob/master/scripts/lib.js)