Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#39846 closed defect (bug) (duplicate)

Protocol agnostic links like // produce login loop reporting cookies disabled

Reported by: dfavor's profile dfavor Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7.2
Component: Administration Keywords:
Focuses: Cc:


If siteurl + home are changed to protocol agnostic links, site login loops... producing the dreaded...

"ERROR: Cookies are blocked or not supported by your browser..." message.

Easy way to reproduce this is to use wp-cli on command line...

wp option set siteurl
wp option set home

After this, site login will loop forever, till siteurl + home are changed to include a protocol, either http: or https: will do.

Change History (3)

#1 @pothi
7 years ago

I use the following code (or similar) in wp-config.php file to let a site to be served on both HTTP and HTTPS, depending on the request...

if (isset($_SERVER['HTTPS']) &&
    ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
    $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
  $wplt_protocol = 'https://';
else {
  $wplt_protocol = 'http://';

$wplt_domain = '';

define('WP_HOME', $wplt_protocol . $wplt_domain);
define('WP_SITEURL', $wplt_protocol . $wplt_domain);

Since the codex recommends to use a protocol for WP_SITEURL and WP_HOME, it can not be considered as a bug, IMO.

#2 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @dfavor, thanks for the ticket!

We're already tracking this issue in #21153.

#3 @dfavor
7 years ago

@SergeyBiryukov - Thanks. Missed the duplicate ticket.

Note: See TracTickets for help on using tickets.