# Shopware 5.7 Login Problem

**URL:** <https://forum.shopware.com/t/shopware-5-7-login-problem/88720>\
**Category:** Shopware 5\
**Created:** [30. Juni 2021 um 15:07 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720 "2021-06-30T15:07:35Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hille](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@Hille](https://forum.shopware.com/u/Hille)\
**Post date:** [30. Juni 2021 um 15:07 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/1 "2021-06-30T15:07:35Z")

</div>

Wenn ich mich unter 5.7.2 anmelden möchte bzw mein Zugangsdaten eingeben habe, erscheint das Login Fenster erneut. Gebe ich dann erneut die Zugangsdaten ein, das gleiche Spiel. Klicke ich auf Reload im Browser, werde ich eingeloggt. Das Problem gab es unter 5.6.10 nicht. Leider tritt das Problem bei allen meiner Shops auf, die unter 5.7.2 laufen. Ich habe auch testweise mal alle Plugins deaktiviert und das Standard Theme aktiviert, das gleiche Problem. Wo liegt das Problem bzw was kann ich machen?

---

<div class="post-metadata">

**Author:** ![Adrian02](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Adrian02](https://forum.shopware.com/u/Adrian02)\
**Post date:** [30. Juni 2021 um 16:43 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/2 "2021-06-30T16:43:28Z")

</div>

Hallo Hille, habe exakt das gleiche Problem. Drück mal den Logout Button im Backend. Spinnt dann völlig, oder? Hab noch keine Lösung. Was verbindet uns? Grüße Adrian

---

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://forum.shopware.com/u/adrian)\
**Post date:** [30. Juni 2021 um 22:23 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/3 "2021-06-30T22:23:35Z")

</div>

Hi Hille, statt Reload kann man auch den Browser Cache leeren und dann geht das Login. Sitze jetzt schon seit Stunden dran. Noch keinen Schritt weiter …

---

<div class="post-metadata">

**Author:** ![Hille](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@Hille](https://forum.shopware.com/u/Hille)\
**Post date:** [1. Juli 2021 um 06:57 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/4 "2021-07-01T06:57:31Z")

</div>

Kann ich bestätigen. Bei einem Logout erfolgt eine Reload Schleife, allerdings nur beim Firefox.  
Ich habe testweise mal eine ganz neue Shopware 5.7.2 Installation gestartet. Gleich beim ersten Backend Login das gleiche Problem. Hier scheint wirklich ein Bug in der 5.7er Version vorzuliegen.

---

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://forum.shopware.com/u/adrian)\
**Post date:** [1. Juli 2021 um 13:30 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/5 "2021-07-01T13:30:46Z")

</div>

Hmm, aber warum sind scheinbar nur wir betroffen? Wenn das ein generelles Problem ist, sollte das Interesse an diesen Thread ja auch größer sein … Liegt es vielleicht an unseren Hostern und deren Serverkonfiguration??

---

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://forum.shopware.com/u/adrian)\
**Post date:** [1. Juli 2021 um 13:42 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/6 "2021-07-01T13:42:16Z")

</div>

Habe meinen Hoster mit kostenpflichtigem Support beauftragt. Drück uns die Daumen!

---

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://forum.shopware.com/u/adrian)\
**Post date:** [1. Juli 2021 um 14:24 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/7 "2021-07-01T14:24:57Z")

</div>

Sie haben es gelöst 😀 😀 😀

Wir haben uns die Installation angesehen und konnten das Problem reproduzieren. Problematisch war Ihre .htaccess im entsprechenden Verzeichnis. Wir haben diese umbenannt (.htaccess\_old) und die Shopware-Standard-.htaccess (die keine Nachteile in Ihrem Fall hat) eingespielt. Damit tritt der Fehler auch nicht mehr auf.

---

<div class="post-metadata">

**Author:** ![Hille](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@Hille](https://forum.shopware.com/u/Hille)\
**Post date:** [1. Juli 2021 um 17:57 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/8 "2021-07-01T17:57:38Z")

</div>

kannst du den Inhalt der .htaccess als Code komplett mal posten.

---

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://forum.shopware.com/u/adrian)\
**Post date:** [1. Juli 2021 um 19:57 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/9 "2021-07-01T19:57:14Z")

</div>

```auto
<IfModule mod_rewrite.c>
RewriteEngine on

#RewriteBase /shopware/

# Fix for office 365 autodiscover feature to prevent CSRF errors
RewriteRule ^autodiscover/autodiscover.xml$ - [F,L,NC]

# HTTPS config for the backend
#RewriteCond %{HTTPS} !=on
#RewriteRule backend/(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule shopware.dll shopware.php
RewriteRule files/documents/.* engine [NC,L]
RewriteRule backend/media/(.*) media/$1 [NC,L]
RewriteRule custom/.*(config|menu|services|plugin)\.xml$ ./shopware.php?controller=Error&action=pageNotFoundError [NC,L]

RewriteCond %{REQUEST_URI} !(\/(engine|files|templates|themes|web)\/)
RewriteCond %{REQUEST_URI} !(\/media\/(archive|banner|image|music|pdf|unknown|video)\/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ shopware.php [PT,L,QSA]

# Fix missing authorization-header on fast_cgi installations
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>

<IfModule mod_alias.c>
    # Restrict access to VCS directories
    RedirectMatch 404 /\\.(svn|git|hg|bzr|cvs)(/|$)

    # Restrict access to root folder files
    RedirectMatch 404 /(autoload\.php|composer\.(json|lock|phar)|README\.md|UPGRADE-(.*)\.md|CONTRIBUTING\.md|eula.*\.txt|\.gitignore|.*\.dist|\.env.*)$

    # Restrict access to shop configs files
    RedirectMatch 404 /(web\/cache\/(config_\d+\.json|all.less))$

    # Restrict access to theme configurations
    RedirectMatch 404 /themes/(.*)(.*\.lock|package\.json|\.gitignore|Gruntfile\.js|all\.less|node_modules\/.*)$
</IfModule>

# Staging environment
#SetEnvIf Host "staging.test.shopware.in" SHOPWARE_ENV=staging

# Development environment
#SetEnvIf Host "dev.shopware.in" SHOPWARE_ENV=dev
#SetEnv SHOPWARE_ENV dev

DirectoryIndex index.html
DirectoryIndex index.php
DirectoryIndex shopware.php

# Disables download of configuration
<Files ~ "\.(tpl|yml|ini)$">
    # Deny all requests from Apache 2.4+.
    <IfModule mod_authz_core.c>
          Require all denied
    </IfModule>

    # Deny all requests from Apache 2.0-2.2.
    <IfModule !mod_authz_core.c>
        Deny from all
    </IfModule>
</Files>

# Enable gzip compression
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/xml text/plain text/css text/javascript application/javascript application/json application/font-woff application/font-woff2 image/svg+xml
</IfModule>

<Files ~ "\.(jpe?g|png|gif|css|js|woff|woff2|ttf|svg|webp|eot|ico)$">
    <IfModule mod_expires.c>
        ExpiresActive on
        ExpiresDefault "access plus 1 month"
    </IfModule>

    <IfModule mod_headers.c>
        Header append Cache-Control "public"
        Header unset ETag
    </IfModule>

    FileETag None
</Files>

# Match generated files like:
# 1429684458_t22_s1.css
# 1429684458_t22_s1.js
<FilesMatch "([0-9]{10})_(.+)\.(js|css)$">
    <ifModule mod_headers.c>
        Header set Cache-Control "max-age=31536000, public"
    </ifModule>

    <IfModule mod_expires.c>
        ExpiresActive on
        ExpiresDefault "access plus 1 year"
    </IfModule>
</FilesMatch>

# Disables auto directory index
<IfModule mod_autoindex.c>
    Options -Indexes
</IfModule>

<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

# AddType x-mapp-php7 .php
# AddHandler x-mapp-php7.php

<IfModule mod_headers.c>
    Header append X-Frame-Options SAMEORIGIN
    # Uncomment the following line to enable HSTS (https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) and force clients to use HTTPS for at least one year (31536000 seconds)
    # Header always set Strict-Transport-Security "max-age=31536000"
</IfModule>

```

---

<div class="post-metadata">

**Author:** ![Steffffi](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/steffffi/32/13846_2.png) [@Steffffi](https://forum.shopware.com/u/Steffffi)\
**Post date:** [2. Juli 2021 um 19:30 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/10 "2021-07-02T19:30:12Z")

</div>

Der Bug dürfte wohl die 5.7’er Version selbst sein. Da aber wohl niemand ein Shopware System produktiv nützt ist das wohl jedem ziemlich egal.

Bemerkenswert, was da wieder an Downtime und Umsatzverlust eingefahren wird.

---

<div class="post-metadata">

**Author:** ![Hille](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@Hille](https://forum.shopware.com/u/Hille)\
**Post date:** [2. Juli 2021 um 19:40 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/11 "2021-07-02T19:40:13Z")

</div>

habe deine htaccess getestet, hat bei mir leider keine Änderungen gebracht. Das Login Problem besteht immer noch.

---

<div class="post-metadata">

**Author:** ![Adrian02](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Adrian02](https://forum.shopware.com/u/Adrian02)\
**Post date:** [3. Juli 2021 um 08:29 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/12 "2021-07-03T08:29:51Z")

</div>

Echt seltsam, bei mir rennt es jetzt wieder ganz normal 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![Hille](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@Hille](https://forum.shopware.com/u/Hille)\
**Post date:** [5. Juli 2021 um 08:09 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/13 "2021-07-05T08:09:18Z")

</div>

Ich konnte das Problem nun lösen. Der Fehler tritt nur bei aktivierten mod\_expires auf, speziell wenn ein Wert für ExpiresByType text/html definiert wurde. Folgender Eintrag in der .htaccess konnte mein Problem lösen

```auto
<IfModule mod_expires.c>
ExpiresByType text/html "access plus 0 seconds"
</IfModule>

```

---

<div class="post-metadata">

**Author:** ![Lalizou](https://avatars.discourse-cdn.com/v4/letter/l/8edcca/32.png) [@Lalizou](https://forum.shopware.com/u/Lalizou)\
**Post date:** [6. Juli 2021 um 16:18 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/14 "2021-07-06T16:18:49Z")

</div>

Gerne hier mal hochvoten:

> **[Shopware Issuetracker](https://issues.shopware.com/issues/SW-26142?_ga=2.164483839.1396256566.1625484532-789095770.1623394628)**

---

<div class="post-metadata">

**Author:** ![der\_lizzard](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@der\_lizzard](https://forum.shopware.com/u/der_lizzard)\
**Post date:** [27. Juli 2021 um 06:22 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/15 "2021-07-27T06:22:53Z")

</div>

Hat bei mir so auch funktioniert! Danke dafür!

---

<div class="post-metadata">

**Author:** ![LarsFischu](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@LarsFischu](https://forum.shopware.com/u/LarsFischu)\
**Post date:** [6. September 2021 um 14:48 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/16 "2021-09-06T14:48:37Z")

</div>

Die .htaccess Anpassung hat bei uns leider keine Lösung herbei geführt. Hat sich ggf. noch jemand mit dem Problem beschäftigt? Laut Ticket ist es zwar in der 5.7.3 gelöst - es ist aber ganz schön nervig, vor allem da bei uns relativ viele Leute im Backend arbeiten und dann auch gleich noch die Logs zugemüllt werden.

Beim Login muss nach dem ersten Versuch die Seite neu geladen werden, damit der Nutzer das Backend aufrufen kann. Beim Logout gibt es dann einen Reload-Loop. Wir sind von 5.6.9 auf 5.7.2 gegangen. Vorher gab es das Problem nicht.

Wir selbst vergleichen morgen nochmal alle Serversettings - bei uns in den Entwicklungsumgebungen tritt das Problem nämlich nicht auf.

---

<div class="post-metadata">

**Author:** ![LarsFischu](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@LarsFischu](https://forum.shopware.com/u/LarsFischu)\
**Post date:** [7. September 2021 um 10:44 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/17 "2021-09-07T10:44:29Z")

</div>

Wir haben das Problem heute nochmal untersucht. Bei uns war die HTTP Header Konfiguration für das Feld Cache-Control so gesetzt, wie hier empfohlen (das wird auch immer von Google PageSpeed verlinkt): [https://web.dev/uses-long-cache-ttl/](https://web.dev/uses-long-cache-ttl/)

Die Probleme mit Login/Logout waren gelöst, nachdem wir diesen Wert wieder auf 0 gesetzt haben. Unter Shopware 5.6.x gab es den Fehler noch nicht.

Meine Frage an Shopware diesbezüglich: Bei GitHub kann man sehen, dass die Lösung zum Ticket im [Shopware Issuetracker](https://issues.shopware.com/issues/SW-26142) das Problem mit neu angelegten Benutzern löst, da diese ja standardmäßig für lockeduntil erstmal den Wert NULL erhalten und dann der Vergleich mit diesem Wert nicht korrekt durchgeführt werden kann. Das ist m.E. aber ein ganz anderes Problem, als im Ticket beschrieben (bezieht sich auf den Kommentar im Ticket aber nicht auf das Caching Problem). Könntet ihr das bitte nochmal überprüfen oder ist das jetzt ein Denkfehler meinerseits?

EDIT: Habe Shopware Entwickler Support dazu angeschrieben. Vielleicht haben wir ja ein Issue / Commit übersehen. Würde ein Update hier rein posten, wenn ich eine Antwort habe.

---

<div class="post-metadata">

**Author:** ![LarsFischu](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@LarsFischu](https://forum.shopware.com/u/LarsFischu)\
**Post date:** [8. September 2021 um 11:12 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/18 "2021-09-08T11:12:53Z")

</div>

Habe eine Antwort erhalten. Es wurde auf den Commit für das Ticket verwiesen und Shopware 5.7.3.

Wir haben das mit Shopware 5.7.3 getestet: Das Problem wurde nicht gelöst. Es wurde nur der Fehler gelöst, wenn ein neuer Benutzer angelegt wurde und dieser sich nicht einloggen kann (ist ein anderes Problem gewesen).

Das Problem mit dem Login tritt dann auf, wenn wie im obigen Beitrag beschrieben mit aktiviertem mod\_expires ein Wert für ExpiresByType text/html gesetzt wurde bzw. im HTTP Header für Cache-Control.

Ich habe deshalb ein neues Ticket aufgemacht: [Shopware Issuetracker](https://issues.shopware.com/issues/SW-26271)

Wer hier immer noch Probleme hat, kann gerne upvoten.

---

<div class="post-metadata">

**Author:** ![DYuz](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@DYuz](https://forum.shopware.com/u/DYuz)\
**Post date:** [16. November 2021 um 15:34 UTC](https://forum.shopware.com/t/shopware-5-7-login-problem/88720/19 "2021-11-16T15:34:59Z")

</div>

If you still have a problem, please check your **.htaccess** file  
and if you have a block like this:

```auto
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 month"
</IfModule>
## EXPIRES CACHING ##

```

please delete this code, it will help solve the problem.
