|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Does anyone have a good script that can create a login to a site protected by htaccess. Also does someone have a script to logout from a site protected by htaccess.
I was thinking the logout could be done with AJAX by asking for a url http://randomstring:randomstring@mysite.com and when that fails to somehow redirect to the homepage. Is this feasable? If somebody has already done this I would love the code. I know one can do logins with "http://username |
|
|||
|
What happens with Javascript disabled?
Can you not use a more standard php / asp log in system? |
|
|||
|
"Does anyone have a good script that can create a login to a site protected by htaccess."
I have used this program for years: SiteInteractive.com - Account Manager Lite :: Free CGI Perl Script |
|
|||
|
I've used Siteinteractive's Pro version for years. I completely forgot I could use it on the other web site I have planned. After visiting their site again, it reminded me of why I bought it in the first place. (smile).
When I first got it, the tech support for the pro version was outstanding. Judith Book Club, Free Self Help Books, Free Fiction Books,Free Money Screensaver, Free Game, Affirmation Movie DVD and more at agoodread.com P.S. I'm not an affiliate but I may change my mind because I've been very happy with their product. |
|
|||
|
Try the following links for just about everything you might want to know about htaccess.
http://www.askapache.com/htaccess/apache-htaccess.html http://www.javascriptkit.com/howto/htaccess.shtml |
|
||||
|
Ok, I figured out a way to do the login with a perl script. All I did was call a script that created a redirect through http-equiv to http://username
I now need to figure out a way to do a logout of an htaccess protected file after being authenticated. I tried writing a script that forces a bogus authentication, this didn't seem to work, even though it did work when done through the browser window. |
|
||||
|
As far as I know and understand .htaccess there is no possibility to logout from an htaccess-protected area, you have to close the browsers window (in FF you have to close _all_ windows!) to make the browser "forget" the login-information for that session.
So if you want do have a solution with "logout" you have to go for - Session-IDs - Cookies - Combination SID and Cookie ... Annotation: don't use a redirect or anything else like http://username
__________________
http://e-dvertising.at/ : e-dvertising - Hinterdorfer & Edlinger OG advertising | werbung - webdesign - fullservice - cms . Graz - Zeltweg / Austria Last edited by e-dvertising; 08-07-2007 at 02:36 AM. |
|
||||
|
e-dvertising is right. You don't actually "log in" to htaccess protected content, so there is no way to actually log out. The username and password prompt that you are shown are not shown by the server, they are generated by your browser. Every time that you access a protected page, the browser is prompted for your username and password. This means that you are actually re-authenticated every time you click on a link. So that you do not need to keep re-entering your password, the browser will remember the last good password either permanently or until the browser is closed. From the server end, you do not have the ability to override this functionality.
Please note, .htaccess IS NOT SECURE as all username/password combinations are transmitted in plain text and can be easily intercepted and used by unauthorized parties to gain access to the protected content.
__________________
The best way to learn anything, is to question everything. |
|
||||
|
When authenticated using basic or digest authentication in apache, the username is stored in the http header REMOTE_USER. If you are using php, the username and password are also stored in the http header as PHP_AUTH_USER and PHP_AUTH_PW.
Regarding logout, cPanel has a logout link. It works as dmadance requires. I dont know if cPanel simply deletes the value for REMOTE_USER or something else entirely. But I use it all the time to switch between various remote databases managed with PHPmyAdmin. |
|
||||
|
i don't know cPanel but i know differnt other panels _and_ i know phpMyAdmin, here you 've got different possibilities to handle the "login" and i guess the one you mentioned is not (only) htaccess-based but uses at least a combined method or even no htaccess at all, cause' esp. with FF you have to close _all_ instances to get rid of the user/pass combination which once has been entered to get a "second" chance to login with another one.
__________________
http://e-dvertising.at/ : e-dvertising - Hinterdorfer & Edlinger OG advertising | werbung - webdesign - fullservice - cms . Graz - Zeltweg / Austria |
|
||||
|
If you use a bad username/password combo to force the user to log out, the following happens:
First, the user wants to visit the secure site... Browser: GET /secureplace/file.html Server: 401 Unauthorized Authenticate Realm Browser shows user a password prompt for the realm "Realm" Browser: GET /secureplace/file.html AUTHENTICATION Realm username:pass Server: 200 OK Then the user clicks a link. Since the browser remembers that this directory requires authentication, it automatically includes the username and password. Browser: GET /secureplace/otherfile.html AUTHENTICATION Realm username:pass Server: 200 OK If you use any process to change the login, such as using a URL with a bad username and password embedded, the following will occur: Browser: GET /secureplace/someotherfile.html AUTHENTICATION Realm baduser:badpass Server: 401 Unauthorized Authenticate Realm Browser: GET /secureplace/someotherfile.html AUTHENTICATION Realm knowngooduser:knowngoodpassfromcache Server: 200 OK
__________________
The best way to learn anything, is to question everything. Last edited by wige; 08-07-2007 at 03:38 PM. |
|
||||
|
Quote:
__________________
God Bless, -Clint (Join Date: 2003) |
|
||||
|
Quote:
|
|
||||
|
Quote:
__________________
God Bless, -Clint (Join Date: 2003) |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How safe is Windows during login? | Dragonsi | Internet Security Discussion Forum | 5 | 10-02-2005 11:01 AM |
| login problem | pbrollwitme | Flash Discussion Forum | 7 | 09-01-2005 06:46 PM |
| Login functionality | anthonyl | Web Programming Discussion Forum | 4 | 09-01-2004 12:16 AM |
| simple login | jmdb71 | Web Programming Discussion Forum | 3 | 08-09-2004 12:27 PM |
| JS Error on login | AlanMCSD | WebProWorld: Guidelines/Announcements/Suggestions | 0 | 10-27-2003 03:23 AM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |