Reply to Re: Session variable problem

Your name:

Reply:


Posted by Vince Morgan on 04/25/07 14:18

"Jonno" <jonattree@gnosis-consultancy.co.uk> wrote in message
news:1177501291.323146.24910@s33g2000prh.googlegroups.com...
> Hi
>
> I am having a problem with session vars being propagated between pages
> on this site:
> =========== logout.php =============
> <?php
> session_start();
> // store to test if they *were* logged in
> $old_user = $_SESSION['loggedinusername'];
> unset($_SESSION['loggedinusername']);
> session_destroy();

This may not actualy destroy everything in the session. The example of
killing a session that uses cookies below is from
http://au.php.net/session_destroy

// 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();

I don't think it's the answer to your prob though. I'll be very interested
to here what others have to say. There was a previous post a few days ago
about a similar problem.
Vince

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация