#39846 closed defect (bug) (duplicate)
Protocol agnostic links like //foo.com produce login loop reporting cookies disabled
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.7.2 |
| Component: | Administration | Keywords: | |
| Focuses: | Cc: |
Description
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 foo.com
wp option set home foo.com
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)
Note: See
TracTickets for help on using
tickets.
I use the following code (or similar) in
wp-config.phpfile 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) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { $wplt_protocol = 'https://'; } else { $wplt_protocol = 'http://'; } $wplt_domain = 'example.com'; 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.