Forum Moderators: phranque

Message Too Old, No Replies

Why does it keep asking for password with every request?

Several sites share content on one site.

         

DKDiveDude

9:33 pm on Jun 16, 2004 (gmt 0)

10+ Year Member



I run several sites, that each has a member section. Each member section is password protected via .htaccess and .htpasswd, which works fine.

However to save space, on since quite a bit of content is the same on several sites, I have put all the content on only one site.

For a short while I tried just checking the referer with Apache, but like I was told here not everybody send a referer.

Then I encrypted files, so only members would know the actual filenames. But then yesterday I noticed a huge jump in bandwidth, and sure enough one of the members had posted content links on a Forum site.

Today I then added password protection using .htaccess and .htpasswd, in the shared content folder.

And finally here is the problem.

I try to logon to of of my sites, fine. When I access a shared content link from another site, or could be same site just another folder, I get a password prompt, and after a successfull entry I get the content.

But then I get prompted for password again when I try another shared content link?

Why is it that I don't get prompted for password when I only use content or links within the same site/folder, but I do when I try to access another site/folder that uses a different .htaccess and .htpasswd?

And how can I overcome this problem?

Thanks

dcrombie

10:10 am on Jun 17, 2004 (gmt 0)



Your browser remembers passwords on a per-domain and (in the better browsers) a per-realm basis. The realm is defined in the .htaccess file.

So as long as the realm AND the domain stay the same you won't need to re-enter your password. If you have a smart browser then it can 'remember' your login for multiple realms on a single domain. This means that you can be 'logged in' to a /members/ area and to an /admin/ area on the same domain at the same time.

Otherwise you will be prompted again every time the realm OR the domain changes.

Clear as mud?

DKDiveDude

12:42 pm on Jun 17, 2004 (gmt 0)

10+ Year Member



Thanks for your reply.

Can you please elaborate on "realm"?

Which browser(s) are that smart?

Finally is there no way using IE, that I can overcome this problem? Cookies maybe?

dcrombie

12:57 pm on Jun 17, 2004 (gmt 0)



I was afraid you'd ask that ;)
Try this link:

[apacheweek.com...]

DKDiveDude

2:05 pm on Jun 17, 2004 (gmt 0)

10+ Year Member



Making the realm name the same, helped.

Also I experienced that using IE, the username and password combination had to be the same in all areas, on the same domain, to prevent reprompting of access in different areas.

However for different domains, the username and password combination for different areas could be different.

Thanks for you help...