Logout macht was es will

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

    Comment


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

      Comment


      • #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

        Comment


        • #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.

          Comment


          • #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

            Comment


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

              Content-Location = "Content-Location" ":"
              ( absoluteURI | relativeURI )
              Seit wann?
              Last edited by martin_duisburg; 23-05-2008, 09:31.
              ad astra
              --- bin nun mal Perry Rhodan Fan ---

              Comment


              • #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

                Comment


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

                  Comment

                  Working...
                  X