function deleteCookie ( cookieName ) { var expireDate = new Date(); var domainis = ".01consulting.co.kr"; //어제 날짜를 쿠키 소멸 날짜로 설정한다. expireDate.setDate( expireDate.getDate() - 1 ); document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString()+ "; domain=" + domainis + "; path=/"; } function logout_mem() { //로그아웃 했을때 저장되어있는 쿠키를 삭제시킨다 location.href = "https://pass.01consulting.co.kr/2027/m/logout/"; } function setCookie( name, value, expirehours ) { var todayDate = new Date(); var domainis = ".01consulting.co.kr"; todayDate.setHours( todayDate.getHours() + expirehours ); document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + "; domain=" + domainis + ";"; } function getCookie( cookieName ) { var search = cookieName + "="; var cookie = document.cookie; // 현재 쿠키가 존재할 경우 if( cookie.length > 0 ) { // 해당 쿠키명이 존재하는지 검색한 후 존재하면 위치를 리턴. startIndex = cookie.indexOf( cookieName ); // 만약 존재한다면 if( startIndex != -1 ) { // 값을 얻어내기 위해 시작 인덱스 조절 startIndex += cookieName.length; // 값을 얻어내기 위해 종료 인덱스 추출 endIndex = cookie.indexOf( ";", startIndex ); // 만약 종료 인덱스를 못찾게 되면 쿠키 전체길이로 설정 if( endIndex == -1) endIndex = cookie.length; // 쿠키값을 추출하여 리턴 return unescape( cookie.substring( startIndex + 1, endIndex ) ); } else { // 쿠키 내에 해당 쿠키가 존재하지 않을 경우 return false; } } else {// 쿠키 자체가 없을 경우 return false; } } function Encrypt(theText) { //모바일 로그인 정보 암호화 output = new String; Temp = new Array(); Temp2 = new Array(); TextSize = theText.length; for (i = 0; i < TextSize; i++) { rnd = Math.round(Math.random() * 122) + 68; Temp[i] = theText.charCodeAt(i) + rnd; Temp2[i] = rnd; } for (i = 0; i < TextSize; i++) { output += String.fromCharCode(Temp[i], Temp2[i]); } return output; } /* function unEncrypt(theText) { //모바일 로그인 정보 복호화 output = new String; Temp = new Array(); Temp2 = new Array(); TextSize = theText.length; for (i = 0; i < TextSize; i++) { Temp[i] = theText.charCodeAt(i); Temp2[i] = theText.charCodeAt(i + 1); } for (i = 0; i < TextSize; i = i+2) { output += String.fromCharCode(Temp[i] - Temp2[i]); } return output; } */ function auto_set_cookie ( ) { var auto_login = getCookie('AUTOLOGIN'); //자동로그인 쿠키값 var IDKEY = getCookie('IDKEY'); //자동로그인 쿠키값 var PWDKEY = getCookie('PWDKEY'); //자동로그인 쿠키값 if ( auto_login == "Y" ) { //자동로그인이 설정되어있으면 쿠키를 자동으로 구워준다(스크립트로) //setCookie("AUTOLOGIN",auto_login,720); //setCookie("IDKEY",IDKEY,720); //setCookie("PWDKEY",PWDKEY,720); } } $(document).ready(function() { auto_set_cookie(); //페이지 오픈시 자동으로 쿠키를 구워주는 부분 $("#m_login").click(function(){ //모바일에서 로그인 버튼클릭시 호출 var auto_login = $(':input[id=keepid]:checkbox:checked').val(); //자동로그인 var uid = $("#uid").val(); var upw = $("#uid").val()+"_"+$("#upw").val(); var auto_pwd = MD5(upw); if ( auto_login == "Y" ) { //자동로그인이 설정되어있으면 로그인했을때 쿠키를 구워준다 //setCookie("AUTOLOGIN",auto_login,720); //setCookie("AUTO_ID",uid,720); //setCookie("AUTO_PWD",auto_pwd,720); } $("#g_login").submit(); }); $("#upw").on("keyup",function(key){ if(key.keyCode==13){ $("#m_login").click(); } }); });