Closed (fixed)
Project:
Secure Site
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2006 at 14:57 UTC
Updated:
12 May 2014 at 18:26 UTC
Jump to comment: Most recent
From issue 21814:
I still (download 4.7) see the behaviour (that's described in the original post) in Opera (win 9.02) and IE (win 6.0). I solved this wayback by adding a random number to all browsers but Firefox.
Here's how the "hack" looked then:
// fix logout on cancel in Opera and IE
$browser_user_agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
if (strstr($browser_user_agent, "gecko")) { //Firefox
$realm = "gecko-browser";
}
else { //Opera, IE, others?
$realm = mt_rand( 1, 1000000000 );
}
header('WWW-Authenticate: Basic realm="'.$realm.'"');
Comments
Comment #1
NaX commentedI tried this hack and it does seam to work. By changing the realm for IE and Opera the PHP_AUTH variables or cleared. This type of workaround would make the user defined Authentication realm feature pointless. Maybe we should look at modifying this workaround so that it adds a suffix to the realm. Its not ideal but maybe a good enough workaround for the time being. Until we find a better solution.
Comment #2
NaX commentedHere is how I implemented your workaround. From my tests it works. I will submit a patch later.
Maybe we should put this in as an admin selected feature. So the site admin can decide if he wants his realm modified.
Something like
Disabled
Enabled with web browser HTTP-AUTH security
Enabled with web browser HTTP-AUTH security, with browser logout workaround
Enabled with HTML login form
And some sort of description of what the workaround does.
Comment #3
junyor commentedSubscribing.
Comment #4
junyor commentedLet's leave out the browser checking and just do it for all browsers. It shouldn't hurt Mozilla. And how about a "-" between the realm and the suffix?
Comment #5
NaX commentedI test it the idea with firefox, but it does not work. Firefox only clears the AUTH variables when the dialog is presented to the user with the same realm that they were created with. I think Firefox is doing things correctly (shocker). I wish all browser would just work the same.
Comment #6
junyor commented@NaX: I'll file a bug report with Opera.
Comment #7
NaX commentedCommitted to DRUPAL-4-7 and HEAD. Please give it a test.
Comment #8
anders.fajerson commentedNice to see this implemented, it didn't show up in "my issues" (it was closed before the post about the new thread was sent) so I missed this. But to be fair, shouldn't I get credit for this patch? ;)
Comment #9
darren ohOf course. This is all your work. I only closed the original issue because the unclosed tags in your last post made replies unreadable and I couldn't get the tags closed.
Comment #10
(not verified) commentedComment #11
NaX commented@Darren Oh
I was wondering if this is correct. ('htps:/')
I was thinking something more like this
If not feel free to close the issue.
Comment #12
NaX commentedPlease disregard my suggestion. It wont work as you requires more than 1 line to call variable_get.
Comment #13
NaX commented