You are here: Re: Why does a session variable return to its old value? « PHP Programming Language « IT news, forums, messages
Re: Why does a session variable return to its old value?

Posted by Erwin Moller on 06/13/07 15:22

damezumari wrote:

> I have just discovered that the problem can be simplified a bit;
> test3.php is not needed.
>
> $_SESSION['classtitle'] = 'b';
> echo 'main: '.$_SESSION['classtitle'].'<br />';
> unset($_SESSION['classtitle']);
> echo '<p><a href="test.php">test</a></p>';
>
> This displays:
>
> main: b
>
> But when I click the link to test.php I get:
>
> test: a
>
> Conclusion: $_SESSION['classtitle'] in test.php is not the same as in
> the main program. How come?
>
> Regards,
>
> Jan Nordgreen

Hi,

This shouldn't happen.
You unset that sessionvar, so it should be gone on test.php, and thus
produce an error.
You *DO* have errorreporting on I hope?
If unsure, inspect your php.ini, or put this above all your files:
error_reporting(E_ALL);

If that doesn't enlighten you in any way: Why don't you post both files here
so we can inspect them?
(Preferably your simplified versions)

Regards,
Erwin Moller

 

Navigation:

[Reply to this 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

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