Re: session_destroy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It doesn't matter, PHP decides automatically which is the best method to make a session persist. If it founds that the client allows cookies, cookies are used. If such method is not available, the session id is writen to every url through an output buffer with an url rewriting filter. There was another method before using the url rewriting but I forgot, check the manual.

Shannon Doyle wrote:

That's just it,

I am not setting a session cookie.

Just starting a session with the following :-


session_name("XPCSESS");
session_start();
$sessID = session_id();



-----Original Message-----
From: Martin Alterisio "El Hombre Gris" [mailto:malterisio777@xxxxxxxxx] Sent: Wednesday, 19 April 2006 12:36 PM
To: Peter Hoskin
Cc: Shannon Doyle; php-general@xxxxxxxxxxxxx
Subject: Re:  session_destroy

That's exactly what the manual says.
session_destroy() doesñ't clean the session cookie (if one is used), that's probably why your session persists.

Peter Hoskin wrote:

I've also had this issue from time to time. Used the following to destroy it under all circumstances.

  if (isset($_COOKIE[session_name()])) {
      setcookie(session_name(), '', time()-42000, '/');
  }
  session_destroy();

Shannon Doyle wrote:

Hi People,

Trying to get a session to destroy correctly, however the darn thing just refuses to destroy. I call the following in a separate webpage in a effort
to destroy the session, only to find that the session still persists.

<?php
session_start();
session_unset();
session_destroy();
Header("Location: index.php");
?>


Any help would be appreciated.

Cheers,

Shannon



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux