![]() |
My assumption is that you need to set a seperate cookie, and then read from that cookie to start a new session when they return.
|
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 Then open /include/login.php and find this code: Code:
db_query("update $sql_tbl[customers] set last_login='".time()."' where login='$login'"); AFTER that put: Code:
# 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). |
Looks like there's some protection in check_useraccount.php against faking cookies or session variables:
Code:
if ($HTTP_POST_VARS["login"] || $HTTP_GET_VARS["login"] || $HTTP_COOKIE_VARS["login"] || $HTTP_POST_VARS["login_type"] || $HTTP_GET_VARS["login_type"] || $HTTP_COOKIE_VARS["login_type"]) { Please be encourage to make this monologue a dialogue ;) |
Got it to work, will post full modification for feedback, criticism and security checks shortly.
|
Here's what's needed. I'm using I beleive 3.2.2, not positive on that.
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:
<? Create another file in that subfolder called: reset_cookie.php with this code in it: Code:
<? Open include/check_useraccount.php and change to look like this: Code:
<? Open up /include/login.php and find where it says this: Code:
# 1) generate $last_login by current timestamp and update database AFTER that, add this: Code:
# Also in include/login.php find this: Code:
if($mode=="logout") { AFTER that add: Code:
include "../modules/Save_Login/reset_cookie.php"; Open up skin1/auth.tpl (Note: I believe I've made some slight changes to this file, maybe just adding the "navlink" class). File should look similar to this: Code:
{* $Id: auth.tpl,v 1.19 2002/09/10 12:36:33 zorg Exp $ *} |
I'm by no means a programming expert, anybody see any security flaws.
There might be an issue with being able to fake cookies. |
Been watching your posts for a while now. I haven't dissected the code yet, but regardless of the outcome - kudos on the work.
|
Thanks. I plan on creating a new reality TV show: The making of an automatic login script :P
Definitely a cookies issue here, password will likely need to be written to a cookie and verified as well, however that could create a security issue in that the password can be pulled from the cookie. |
Quote:
Oh yeah? I heard FOX was going to produce it |
Naturally.
|
All times are GMT -8. The time now is 05:44 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.