A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearautomatic htaccess login - multiple protected dirs accessed from one login - page 1
User InfoPosts
automatic htaccess login - multiple protected dirs accessed from one login#1
I am trying to make a php login page that allows users to access multiple .htaccess protected pages (on apache server). So a user would enter a password in a form on page 1 and depending on which login they provided, they would be sent to one directory or another, but I want the login to happen automatically to the subsequent pages (login is only required on page 1). How does one go about auto logging into an htaccess page if the proper credentials are provided on a referring page? I don't want to append credentials in the url ?user=user&pass=pass

posted date: 2008-12-09 10:54:00


Re: automatic htaccess login - multiple protected dirs accessed from one login#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-09 10:54:01


Re: automatic htaccess login - multiple protected dirs accessed from one login#3
If the other pages are in the same directory or below most browsers will keep sending the same credentials for subsequent requests if you have the same .htaccess-rules for all the files/directories.Another alternative to passing ?user=user&pass=pass would be to use POST instead of GET to sendt this request (if you are passing on from a form that is).

posted date: 2008-12-09 11:51:00


Re: automatic htaccess login - multiple protected dirs accessed from one login#4
"sending the same credentials for subsequent requests" this would necessitate adding both user and pass combinations to the top level directory so that either one works for top level and redirect happens afterwards. The client requested that we not do that. I thought only GET was acceptable??

posted date: 2008-12-09 11:56:00


Re: automatic htaccess login - multiple protected dirs accessed from one login#5
If you use multiple .htaccess files be sure to set the AuthName the same. This tells the browser that the same cached uid/password should be provided for that "Realm".

posted date: 2008-12-09 12:45:00


Re: automatic htaccess login - multiple protected dirs accessed from one login#6
Just to be clear, are you saying you are using form-based authentication in your first page instead of HTTP-based authentication?

posted date: 2008-12-09 15:12:00


Re: automatic htaccess login - multiple protected dirs accessed from one login#7
I was going to, but I wound up implementing the suggestions I got here (adding subsequent page passwords to index htaccess file). It works great. as well, I think you can use modperl to make the popup sit in a form on the page so that it looks like a regular form.

posted date: 2008-12-09 16:21:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.