Logout macht was es will

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Logout macht was es will

    Hi Leute,

    mein Logout funktioniert mal und mal nicht, so wie der gerade will.
    Woran liegt das und kennt ihr eine bessere Lösung um sich auszuloggen?!


    PHP-Code:
    <?php

    session_start
    ();
    session_destroy();
    header('Location: index.php');

    ?>

  • #2
    PHP Manual - session_destroy()
    PHP-Code:
    // Initialize the session.
    // If you are using session_name("something"), don't forget it now!
    session_start();

    // Unset all of the session variables.
    $_SESSION = array();

    // If it's desired to kill the session, also delete the session cookie.
    // Note: This will destroy the session, and not just the session data!
    if (isset($_COOKIE[session_name()])) {
        
    setcookie(session_name(), ''time()-42000'/');
    }

    // Finally, destroy the session.
    session_destroy(); 
    Zu deiner Frage: Was konkret bedeutet "funktioniert mal und mal nicht"? Wie sehen die Session-Einstellungen in der php.ini aus?

    Grüße
    Nieder mit der Camel Case-Konvention

    Kommentar


    • #3
      Location-Header erwartet eine vollständige URL.

      Kommentar


      • #4
        Original geschrieben von TobiaZ
        Location-Header erwartet eine vollständige URL.
        echt? also funktionieren tuts auch so, wie oben beschrieben .. ICH habe damit keine probleme
        Gruß
        Uzu

        private Homepage

        Kommentar


        • #5
          echt? also funktionieren tuts auch so, wie oben beschrieben .. ICH habe damit keine probleme
          Das es tolleriert wird, bedeutet ja nicht zwangsläufig, dass es richtig ist.

          Kommentar


          • #6
            see 14.30 Location
            For 3xx responses, the location SHOULD indicate the server's preferred URI for automatic redirection to the resource. The field value consists of a single absolute URI.

            Location = "Location" ":" absoluteURI

            Kommentar


            • #7
              Location-Header erwartet eine vollständige URL.

              Content-Location = "Content-Location" ":"
              ( absoluteURI | relativeURI )
              Seit wann?
              Zuletzt geändert von martin_duisburg; 23.05.2008, 09:31.
              ad astra
              --- bin nun mal Perry Rhodan Fan ---

              Kommentar


              • #8
                Original geschrieben von martin_duisburg
                Seit wann?
                Schon immer. Es spricht hier ja auch niemand von einem «Content-Location»-Header, sondern von einem «Location»-Header.
                Gruss
                H2O

                Kommentar


                • #9
                  Augen auf!!!
                  Content-Location-Header !== Location-Header
                  Wir werden alle sterben

                  Kommentar

                  Lädt...
                  X