After successful login I get logged out!

Please post answers on the most frequently asked questions about CMSimple
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

After successful login I get logged out!

Post by cmb » Tue Mar 13, 2012 10:40 pm

(Deutsche Übersetzung im nächsten Post)

The phenomenon: you log in successfully and see the administration back-end. On the first navigation (clicking an admin menu item, navigating to another page, saving the page content from the editor etc.) you get logged out!

The problem: the login cookies couldn't be set. Either the browser doesn't accept cookies or the server doesn't send them. Probably the latter is the case, but please double check, that your browser does accept cookies.

Well, let's presume the server doesn't send the cookies. This is probably caused by some premature output. So check, that
  • your site doesn't contain a BOM in any of the PHP files: see http://cmsimpleforum.com/viewtopic.php?f=4&t=3583

    If there's a BOM, you have to find the respective file. In the cmsimple/ folder check config.php, languages/en.php and languages/enconfig.php (or the respective files for your language), cms.php and login.php with an editor, which tells you the encoding of the files. It should be UTF-8 without BOM -- otherwise convert it to this encoding. If you're using a version before CMSimple_XH 1.2 the encoding is probably different -- but it should never be UTF-8 with BOM.
  • your PHP files don't contain any characters outside of <?php ... ?>

    If there are superfluous characters, delete them.
  • there's no error output of PHP (warnings, notices) on top of the screen

    If there is error output of PHP check your PHP ini settings from CMSimple_XH's back-end: error_reporting should be 0 and display_errors should be Off. If the settings are different, you either have enabled XH debug mode or the server configuration forbids to change these settings dynamically. The latter has to be changed by your provider.

    Ideally there shouldn't be any error output at all independent of the respective settings, so report it to the developers. OTOH: most of these warnings and notices are quite harmless.
Christoph

PS: Make sure, you don't use a subdomain which contains an underscore.
Last edited by cmb on Sat Apr 13, 2013 8:35 pm, edited 3 times in total.
Reason: added link to German translation; added PS
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Nach erfolgreichem Login werde ich wieder ausgeloggt!

Post by cmb » Tue Mar 13, 2012 11:07 pm

Das Phänomen: Du loggst Dich erfolgreich ein und siehst den Administrationsbereich. Bei der ersten Navigation (Anklicken eines Admin-Menüpunkts, Wechseln zu einer anderen Seite, Speichern des Seiteninhalts im Editor) wirst Du ausgeloggt!

Das Problem: die Login-Cookies konnten nicht gesetzt werden. Entweder akzeptiert der Browser keine Cookies, oder der Server sendet diese nicht. Wahrscheinlich ist letzteres der Fall, aber bitte prüfe genau, dass der Browser Cookies akzeptiert.

Okay, nehmen wir an, dass der Server die Cookies nicht sendet. Das wird vermutlich durch irgendeine verfrühte Ausgabe verursacht. Also prüfe, dass
  • Deine Website kein BOM in einer der PHP-Dateien hat: siehe http://cmsimpleforum.com/viewtopic.php?f=4&t=3583

    Wird eine BOM gefunden, musst Du die betreffende Datei suchen. Prüfe config.php, languages/de.php und languages/deconfig.php (bzw. die entsprechenden Dateien Deiner Sprache), cms.php und login.php im cmsimple/ Ordner mit einem Editor, der die Kodierung der Dateien anzeigt. Diese sollte UTF-8 ohne BOM sein -- falls nicht, konvertiere sie zu dieser Kodierung. Falls du eine CMSimple-Version vor 1.2 verwendest, ist die Kodierung wahrscheinlich anders -- aber sie sollte nie UTF-8 mit BOM sein.
  • Deine PHP-Dateien keine Zeichen außerhalb von <?php ... ?> enthalten

    Wenn dort solche überflüssigen Zeichen sind, lösche sie.
  • keine Fehlermeldungen (Warnings, Notices) von PHP ausgegeben werden

    Falls PHP-Fehlermeldungen angezeigt werden, prüfe Deine PHP-Ini-Einstellungen aus CMSimple_XHs Administrationsbereich: error_reporting sollte 0 und display_errors sollte Off sein. Wenn diese Einstellungen anders sind, hast Du entweder den XH debug mode aktiviert, oder die Server-Konfiguration verbietet diese Einstellungen zur Laufzeit zu ändern. Letzteres sollte von Deinem Provider geändert werden.

    Idealerweise sollten, unabhängig von den Einstellungen, überhaupt keine PHP-Fehlermeldungen ausgegeben werden; also ggf. den Entwicklern melden. Andererseits sind die meisten dieser Warnungen und Hinweise eher harmlos.
Christoph

PS: Stelle sicher, dass die Subdomain keinen Unterstrich enthält.
Last edited by cmb on Sat Apr 13, 2013 8:36 pm, edited 1 time in total.
Reason: PS hinzugefügt
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply