Answers.Body: <p>I was able to get most of the way by changing to PHP 5.6 which let us login.</p>
  <p>Next was to add <code>'overridePhpSessionLocation' =&gt; true</code> to <code>general.php</code> (as described <a href="https://craftcms.stackexchange.com/questions/4653/getting-logged-out-of-admin-area-when-refreshing-site">here</a>)</p>
  <p>No idea why this site specifically does this but it has stopped for now.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-26T12:33:54.957Z
Answers.LastActivityDate: 2022-10-26T12:33:54.957Z
Answers.UserDisplayName: Jaytrix
Body: <p>Working on a Craft 2 site and trying to login with the admin account. We can login to the live site without any problems but when trying to login to a dev environment (using DDEV) the password isn't accepted. This is after doing a backup of the live database and importing it minutes later.<br />
  At least one other colleague has tried the same site on a different machine and it does the same.</p>
  <p>A colleague created a new account on the live site, downloaded the DB then imported again. Cannot login with the new account (can on the live site).</p>
  <p>I've cleared the logs and can see there's a lot of <code>[system.web.CHttpSession] Failed to start session.</code> when clicking on the login button. I have the same PHP version as the live site.</p>
  <p>Currently downloading the Craft/App folder from the live site to see if that does anything different</p>
  <p>Craft folder from live site had no affect.</p>
  <p>Deleted the contents of <code>craft/storage</code> and now the logs show one <code>warning</code> of <code>[application] admin tried to log in unsuccessfully.</code>. This appears straight after an <code>UPDATE</code> command on <code>craft_users</code>. I can see sessions are being added to the database so I don't think it's an issue updating the database</p>
  <p>Doesn't appear to be Craft 2 &lt;-&gt; DDEV issue. I've got another Craft 2 site running OK. Tried using that site's app folder which also didn't make a difference.</p>
  <p>Update: Downgraded PHP to 5.6 and can now login BUT get logged out shortly after.</p>
  
Tags: <admin><login><craft2>
Title: Admin account password doesn't work in local environment but does on live site
ThreadText: # Admin account password doesn't work in local environment but does on live site
  
  (Asked by: username_0 on 2022-10-26)
  
  Working on a Craft 2 site and trying to login with the admin account. We can login to the live site without any problems but when trying to login to a dev environment (using DDEV) the password isn't accepted. This is after doing a backup of the live database and importing it minutes later.  
  At least one other colleague has tried the same site on a different machine and it does the same.
  
  A colleague created a new account on the live site, downloaded the DB then imported again. Cannot login with the new account (can on the live site).
  
  I've cleared the logs and can see there's a lot of `[system.web.CHttpSession] Failed to start session.` when clicking on the login button. I have the same PHP version as the live site.
  
  Currently downloading the Craft/App folder from the live site to see if that does anything different
  
  Craft folder from live site had no affect.
  
  Deleted the contents of `craft/storage` and now the logs show one `warning` of `[application] admin tried to log in unsuccessfully.`. This appears straight after an `UPDATE` command on `craft_users`. I can see sessions are being added to the database so I don't think it's an issue updating the database
  
  Doesn't appear to be Craft 2 <-> DDEV issue. I've got another Craft 2 site running OK. Tried using that site's app folder which also didn't make a difference.
  
  Update: Downgraded PHP to 5.6 and can now login BUT get logged out shortly after.
  
  **Tags:** admin, login, craft2
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-10-26. Score: 2
  
  I was able to get most of the way by changing to PHP 5.6 which let us login.
  
  Next was to add `'overridePhpSessionLocation' => true` to `general.php` (as described [here](https://craftcms.stackexchange.com/questions/4653/getting-logged-out-of-admin-area-when-refreshing-site))
  
  No idea why this site specifically does this but it has stopped for now.
  
  
  ---
  
  