View Single Post
  #12  
Old 05-22-2003, 01:05 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Ok. So we set a cookie:

Create a sub-folder in the Modules folder called: Save_Login

Create a file in the sub-folder called: set_cookie.php and put this code in it:

Code:
// Set cookie with login name $savelogin = $user_data['login']; setcookie("LoginCookie", $savelogin, time()+3600*24*180, "/", $xcart_http_host); $savelogintype = C; setcookie("LoginTypeCookie", $savelogintype, time()+3600*24*180, "/", $xcart_http_host);

Then open /include/login.php and find this code:

Code:
db_query("update $sql_tbl[customers] set last_login='".time()."' where login='$login'"); db_query("insert into $sql_tbl[login_history] (login, date_time, usertype, action, status, ip) values ('$username',now(),'$usertype','login','success','$REMOTE_ADDR')");

AFTER that put:

Code:
# # Set Remember Login Cookie # if ($login_type == "C") { include "../modules/Save_Login/set_cookie.php"; }

If the person is a customer, they now have a LoginCookie set under the domain name containing "username" and "logintype" where C is the userlevel, set to expire in 6 months.

Now we need to read from that cookie. (I'm documenting the process but don't believe this code to be correct until the process is finished).
Reply With Quote