Source for file logout.php

Documentation is available at logout.php

  1. <?php
  2. /**
  3. * Logout Script
  4. *
  5. * Destroys the session, which is necessary to logout the user.
  6. * @package Phone2Dev
  7. * @author Stanislav Miroshnikov
  8. * @todo add template support
  9. */
  10. //start the session
  11. session_start();
  12. ?>
  13. <html>
  14. <head>
  15. <title>Phone2Dev: Logout</title>
  16. </head>
  17. <body>
  18. <h1>Phone2Dev Logout</h1>
  19. <?php
  20. // unset all of the session variables
  21. $_SESSION = array();
  22.  
  23. if (isset($_COOKIE[session_name()])) {
  24. setcookie(session_name(), '', time()-42000, '/');
  25. }
  26.  
  27. // destroy the session.
  28. session_destroy();
  29.  
  30. print "<p><h2>You are logged out.</h2> Go to <a href=\"login.php\">login page </a> to log back in.</p>";
  31.  
  32. ?>
  33. </body>
  34. </html>

Documentation generated on Tue, 4 Jan 2005 13:47:59 -0500 by phpDocumentor 1.3.0RC3