Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix domain cookie value with http port #5115

Merged
merged 2 commits into from
Apr 6, 2016

Conversation

rixbeck
Copy link
Member

@rixbeck rixbeck commented Apr 4, 2016

Default cookie domain value can't contain server's http port number.
Resolves partially #5014 and resolves #5114

@bobdenotter
Copy link
Member

For me (locally) this breaks in entirely different ways:

screen shot 2016-04-05 at 12 20 08

$hostname = $_SERVER['SERVER_NAME'];
} elseif (isset($_SERVER['HTTP_HOST'])) {
$hostname = reset(explode(':', $_SERVER['HTTP_HOST']));
} else {
$hostname = '';
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to go for something like:

            $request = Request::createFromGlobals();
            if ($request->server->get('HTTP_HOST', false)) {
                $hostHeaders = explode(':', $request->server->get('HTTP_HOST'));
                $hostname = reset($hostHeaders);
            } elseif ($request->server->get('SERVER_NAME', false)) {
                $hostname = $request->server->get('SERVER_NAME');
            } else {
                $hostname = '';
            }

@bobdenotter
Copy link
Member

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants