You are here: session (was: -> PHP4 Singleton implementation question <-) « PHP Programming Language « IT news, forums, messages
session (was: -> PHP4 Singleton implementation question <-)

Posted by Dikkie Dik on 11/30/06 15:16

<snip>
> I also tried to set a $_SESSION['welcome'] variable, but still, each
> time I reenter my page, it's reassigned a new instance.
>
> It's crazy, I would never have thought that it would be such a hassle
> to keep a variable value between pages (without using URL parameters).


Sorry, I did not correctly read your message, and I thought it was
re-created within one page request. If you want something kept between
page requests, you'll need a session. There's no need to store the
object itself in the session, although that is not impossible. Even
then, the object will be re-created (unserialized) for each page visit.
You can store just the data itself in the session (I assume it is one or
more arrays) and have your instance check for existence of that session
data at instantiation. Be sure to start the session before any data is
sent to the client by calling session_start(). See
http://nl3.php.net/manual/en/function.session-start.php for more info.

Best regards.

 

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

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