Re: php .htaccess autologin
| From: | Jas | Date: | Thu, 11 Dec 2003 21:40:27 +0000 |
| Subject: | Re: php .htaccess autologin | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172530@lists.php.net to get a copy of this message | ||
Combination of session vars and cookie vars...
example...
[login page]
sets cookie with auth=0 (variable)
sets session with auth=0 (variable)
[logged in page(s)]
sets cookie with auth=1 (variable -client side)
sets session with auth=1 (variable -server side)
hash of users password as client side var
then just write a function to look on the users machine for a cookie from your site with auth=1, then if you see that present simply authenticate the user.
HTH
Jas
Evan Nemerson wrote:
On Thursday 11 December 2003 04:17 pm, ROBERT MCPEAK wrote:I've dug around quite a bit and can't figure out how I might use PHP to handle an .htaccess login. For example, if I wanted a script to log in the user, rather than the user logging in with the standard .htaccess dialog. Any ideas?I could be wrong, but I think this would be rather client-dependent. I don't think HTTP remembers who you throughout a session- i think the headers get sent every time. My only idea from PHP would be to set the $_SERVER['PHP_AUTH_*'] stuff, but i sincerely doubt that would do anything. I just don't think there's a way to ask the browser to set that info through http. Maybe ask @ javascript forum? If you find a solution, I'd love to hear it...Since the .htaccess vars are stored in the browser, should I be looking at a PHP/JavaScritpt 1-2 punch? Thanks, Bob