craftcms / craftcms/cms

recent Chrome https behavior can lead to inability to log into Craft after timeout

Open
#2,090 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity:minor
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

Description

This is a cute one. You can log in ok without https, while getting the nowadays insecure warning. Maybe you also enter the CP afterwards using https, Then the original login times out while you work. Now you silently fail to log in every time, even if you put https:// in front of the path and request it.

The only way to recover is to remove browser cache including cookies, which kind of hints where this problem lands in Craft. This recovery can be particularly troublesome if you're using Local Storage, as this will be wiped when you clear cookies.

Steps to reproduce
  1. be on a dev site that has https, but not force-https; enabled Vagrant latest in this case
  2. log in to the CP, not using https
  3. later, go to a CP page using https. This can easily occur if you had set up a debug ensemble like PhpStorm to use https -- precisely because of related problems with Chrome canaries.
  4. Be working on something so that the original login times out
  5. Attempt to log in.
  6. You get silently returned to the login page, after a short delay, every time.
  7. Attempting to put https:// ahead of the login page gets same fail
Additional info

PHP version 7.1.7-1+ubuntu16.04.1+deb.sury.org+1
Database driver & version MySQL 5.7.19-0ubuntu0.16.04.1
Image driver & version GD 7.1.7-1+ubuntu16.04.1+deb.sury.org+1
Craft edition & version Craft Pro 3.0.0-beta.30 dev-develop
Yii version 2.0.13
Twig version 2.3.2
Guzzle version 6.2.1
Imagine version 0.7-dev
Plugins yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the timeout and failed re-login sequence described in the issue on a dev site with HTTPS available but not forced, using the listed Craft, PHP, Yii, and MySQL versions where possible. Investigate the login, cookie, and session behavior across HTTP and HTTPS; done means a timed-out user can log in again without clearing browser cookies or local storage.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.