You are here: Re: [PHP] lack of understanding of sessions « PHP « IT news, forums, messages
Re: [PHP] lack of understanding of sessions

Posted by Richard Davey on 10/04/42 11:23

Hello Sabine,

Monday, August 8, 2005, 7:17:51 PM, you wrote:

S> When I call the script for the first time the output is:
S> if, test: test
S> if, sesstest: test
S> test: test
S> sesstest: test
S> if, test2: test2
S> test2: test2

S> on all servers.
S> Additionaly I get a warning for the session_register-part on the
S> PHP5-server. Thats ok.

You shouldn't really be using it even on 4.0.6, best remove it now and
the warning will go too.

S> PHP4.3.10:
S> else, test:
S> else, sesstest:
S> test:
S> sesstest:
S> else, test2:
S> test2:
S> I don't understand, why the variables seem to be empty.

Dump out the session contents and see what's in there (if anything):

print_r($_SESSION);

Equally, dump out the cookie super global to see if the session cookie
even got set

print_r($_COOKIE);

Or use the Web Developer extension for Firefox and "Display cookies"
after the first page load - you should see the PHPSESSID cookie in
existence. If not, that's the problem. If so, what does it say?

S> In the session_is_registered-part, the var seems to be empty, too. Why?

Because even 4.0.6 shouldn't be using that function. If you want to
check for the existence of a variable, use isset().

Best regards,

Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
Zend Certified Engineer
"I do not fear computers. I fear the lack of them." - Isaac Asimov

 

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

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