Closed
Bug 481313
Opened 17 years ago
Closed 16 years ago
Give aus2 users a unique cookie.
Categories
(AUS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: oremj, Assigned: oremj)
Details
Attachments
(3 files, 1 obsolete file)
1.48 KB,
patch
|
morgamic
:
review+
|
Details | Diff | Splinter Review |
1.16 KB,
patch
|
morgamic
:
review+
|
Details | Diff | Splinter Review |
614 bytes,
patch
|
reed
:
review+
|
Details | Diff | Splinter Review |
Each user that visits aus2 needs to receive a unique cookie. Currently we do this with mod_usertrack, but it doesn't work very well with proxies. The patch below is untested (because I don't have a dev copy of aus2 set up), but should do the trick.
Assignee | ||
Comment 1•17 years ago
|
||
in the patch s/microtime()/microtime(true)/
Comment 2•17 years ago
|
||
I have a test env set up here:
http://khan.mozilla.org:8080/VerifyAus
We can apply the patch and see if acceptance tests work.
Comment 3•17 years ago
|
||
Comment on attachment 365336 [details] [diff] [review]
Implements unique cookie
>+//Are we behind a proxy and given the IP via an alternate enviroment variable? If so, use it.
>+if (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
>+ $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
>+} else {
>+ $ip = $_SERVER["REMOTE_ADDR"];
>+}
As we found out with bugzilla, $_SERVER["HTTP_X_FORWARDED_FOR"] can be an array of proxy servers, so we need to get the correct IP from it...
Something like this code that I just took from some website:
<?php
function get_ip_list() {
$tmp = array();
if (isset($_server['http_x_forwarded_for']) && strpos($_server['http_x_forwarded_for'],',')) {
$tmp += explode(',',$_server['http_x_forwarded_for']);
} elseif (isset($_server['http_x_forwarded_for'])) {
$tmp[] = $_server['http_x_forwarded_for'];
}
$tmp[] = $_server['REMOTE_ADDR'];
return $tmp;
}
?>
Comment 4•17 years ago
|
||
Which of the IPs reflects the client IP, though? That's the one we want.
Assignee | ||
Comment 5•17 years ago
|
||
I think this will work:
list($ip) = explode(', ',$_SERVER["HTTP_X_FORWARDED_FOR"]);
Assignee | ||
Comment 6•17 years ago
|
||
Attachment #365336 -
Attachment is obsolete: true
Comment 7•17 years ago
|
||
Comment on attachment 365347 [details] [diff] [review]
Patch with microtime and multiple IP fix.
Looks good to me - passes acceptance tests and cookie issued as required.
Attachment #365347 -
Flags: review+
Assignee | ||
Comment 8•17 years ago
|
||
Justin, when do you want to push this?
Comment 9•17 years ago
|
||
once you guys are satisfied it's ready for production, asap. would *really* like to get this in blocklist at the same time...but I am pretty sure the patch would be a different animal - separate bug?
Assignee | ||
Comment 10•17 years ago
|
||
Blocklist will require a separate patch, but it is blocked on Bug 479070 for now. Mike tested the patch and it appears to be production ready. Let's push tomorrow.
Comment 11•17 years ago
|
||
Checked this into AUS.
Comment 12•17 years ago
|
||
is this tested and ready to go?
Comment 13•17 years ago
|
||
Yeah, from our end. Since it involved a header change and acceptance tests passed wasn't feeling that QA needs to spend time on it. It's tagged for prod.
Assignee | ||
Comment 14•17 years ago
|
||
I'll close this bug out. The production push bug is Bug 480649.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 15•17 years ago
|
||
Assignee | ||
Updated•17 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•17 years ago
|
Attachment #365931 -
Flags: review?(morgamic)
Comment 16•17 years ago
|
||
Comment on attachment 365931 [details] [diff] [review]
Makes cookie name and domain configurable.
I'm ok with this, but if someone doesn't update their config file it's gonna bork their AUS install.
Attachment #365931 -
Flags: review?(morgamic) → review+
Comment 17•17 years ago
|
||
Acceptance tests still applied, patch was committed and tagged.
Assignee | ||
Updated•17 years ago
|
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Assignee: morgamic → oremj
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 18•16 years ago
|
||
Cookie name was hard coded. This patch fixes the issue. Mike, will you commit this patch? I'll update after.
Attachment #385329 -
Flags: review?(morgamic)
Comment 19•16 years ago
|
||
Comment on attachment 385329 [details] [diff] [review]
Fix cookie name
r=reed.
I can commit this if you need somebody to.
Attachment #385329 -
Flags: review?(morgamic) → review+
Assignee | ||
Comment 20•16 years ago
|
||
Yes please.
Comment 21•16 years ago
|
||
Checking in xml/index.php;
/cvsroot/mozilla/webtools/aus/xml/index.php,v <-- index.php
new revision: 1.24; previous revision: 1.23
done
Tagging now.
Status: REOPENED → RESOLVED
Closed: 17 years ago → 16 years ago
Resolution: --- → FIXED
Comment 22•16 years ago
|
||
Tagged, AUS2_PRODUCTION, AUS2_STAGING, AUS2_RTM_200906260000
Comment 23•16 years ago
|
||
Can ops run some tests on the logs to ensure this is fixed before metrics runs a longer test (takes 2-3 days)? Please post results.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 24•16 years ago
|
||
(In reply to comment #23)
> Can ops run some tests on the logs to ensure this is fixed before metrics runs
> a longer test (takes 2-3 days)? Please post results.
Ran several requests and only was issued a new cookie when my browser did not submit one.
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•