Skip to content
컴퓨터잡담
2010.04.05 16:43

로그인 아이디 쿠키로 기억하기

조회 수 10966 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

로그인 아이디 쿠키로 기억하기


아직 테스트 해보진 못했네요. ㅋ;


출처 : http://jsguide.net/ver2/examples/index.php?mode=view&category=7&qstr=&uid=176&page=1


<html> <head> <script language="javascript"> function setCookie (name, value, expires) { document.cookie = name + "=" + escape (value) + "; path=/; expires=" + expires.toGMTString(); } function getCookie(Name) { var search = Name + "=" if (document.cookie.length > 0) { // 쿠키가 설정되어 있다면 offset = document.cookie.indexOf(search) if (offset != -1) { // 쿠키가 존재하면 offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset) // 쿠키 값의 마지막 위치 인덱스 번호 설정 if (end == -1) end = document.cookie.length return unescape(document.cookie.substring(offset, end)) } } return ""; } function saveid(form) { var expdate = new Date(); // 기본적으로 30일동안 기억하게 함. 일수를 조절하려면 * 30에서 숫자를 조절하면 됨 if (form.checksaveid.checked) expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30); // 30일 else expdate.setTime(expdate.getTime() - 1); // 쿠키 삭제조건 setCookie("saveid", form.id.value, expdate); } function getid(form) { form.checksaveid.checked = ((form.id.value = getCookie("saveid")) != ""); } </script> </head> <body onLoad="getid(document.mainform)"> <form name=mainform> 아이디 <input type=text name=id> 암호 <input type=password name=pw> <input type=checkbox name=checksaveid onClick="saveid(this.form)">아이디 기억 </form> </body> </html>

로그인 후 댓글쓰기가 가능합니다.

?

  1. 05
    Apr 2010
    16:43

    로그인 아이디 쿠키로 기억하기

    Category컴퓨터잡담 Views10966
    Read More
  2. 04
    Oct 2010
    08:25

    [엑셀] 와일드카드 문자의 변환처리 방법

    Category컴퓨터잡담 Views10961
    Read More
  3. 27
    Aug 2021
    17:16

    파이썬 JSON으로 받아온 데이터의 Key 값 가져오기

    Category컴퓨터잡담 Views10958
    Read More
  4. 22
    Nov 2012
    10:31

    핀란드의 교육과 유태인의 교육

    Category종교와철학 Views10927
    Read More
  5. 22
    Feb 2012
    07:54

    autohotkey) WinSpector spy를 이용한 post,sendmessage Control ID 추출하기

    CategoryAutoHotKey Views10908
    Read More
  6. 08
    Apr 2016
    13:04

    정일선 갑질 메뉴얼로 세상을 흔들다

    Category연예정보 Views10889
    Read More
  7. 25
    Mar 2016
    23:21

    이열음 열음엔터테인먼트? 이뿌니 심쿵녀로 나와

    Category연예정보 Views10882
    Read More
  8. 23
    Jan 2018
    20:36

    자주 쓰이는 정규식(Regular Expression)

    CategoryHTMLPHPMSQL Views10864
    Read More
  9. 22
    Nov 2018
    21:21

    마지기 계산방법

    Category유용한상식 Views10859
    Read More
  10. 05
    Feb 2010
    08:55

    HTML 엔티티(Entities)

    Category컴퓨터잡담 Views10845
    Read More
Board Pagination Prev 1 ... 80 81 82 83 84 ... 235 Next
/ 235

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소