반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- jquery
- 플러터
- java
- script
- android
- kotlin2.0
- Coroutine
- php
- Flutter
- 설치
- node.js
- ios
- 이클립스
- php개발
- node
- php변수
- 그림으로 배우는 서버구조
- Kotlin
- Eclipse
- 서버
- 변수
- SwiftUI
- 코틀린
- 스나이퍼팩토리
- 정보처리기사
- Flow
- 스터디
- express
- 조건문
- kotlininaction
Archives
- Today
- Total
mygomii
[script] #쿠키를 위한 함수(setCookie,getCookie,deleteCookie) 본문
반응형
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | //쿠키를 위한 함수 function setCookie(cookieName, value, exdays){ var exdate = new Date(); exdate.setDate(exdate.getDate() + exdays); var cookieValue = escape(value) + ((exdays==null) ? "" : "; expires=" + exdate.toGMTString()); document.cookie = cookieName + "=" + cookieValue; } function deleteCookie(cookieName){ var expireDate = new Date(); expireDate.setDate(expireDate.getDate() - 1); document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString(); } function getCookie(cookieName) { cookieName = cookieName + '='; var cookieData = document.cookie; var start = cookieData.indexOf(cookieName); var cookieValue = ''; if(start != -1){ start += cookieName.length; var end = cookieData.indexOf(';', start); if(end == -1)end = cookieData.length; cookieValue = cookieData.substring(start, end); } return unescape(cookieValue); } |
반응형
'JavaScript&JQuery' 카테고리의 다른 글
[script&Jquery] #두개의 날짜 범위 설정 datepicker (0) | 2018.05.02 |
---|---|
[script&Jquery] #빈값(null) 체크하기 (1) | 2018.04.24 |
[script&Jquery] #체크박스 전체선택&해제&삭제하기 (2) | 2018.04.20 |
[script&Jquery] #비밀번호 유효성(회원가입) - 영문+숫자+특수문자 (0) | 2018.04.14 |
[script&Jquery] #쿠키(Cookie)를 이용한 ID정보기억 (0) | 2018.03.17 |