You are here: Re: Passing session variables across pages « PHP Programming Language « IT news, forums, messages
Re: Passing session variables across pages

Posted by Mike Roetgers on 05/02/07 07:39

K. A. schrieb:
> I have two servers at work, 'A' for testing and development, and
> server 'B' for production.
> On server A, I wrote a PHP test code to login users then direct them
> to a personalized page. This is done in 3 steps:
> Step 1. Normal http login page.
> Step 2. A page called login.php that takes the posted username, stores
> it as $_SESSION["username"], and registers it
> session_register("username"); user is taken to the personalized page
> according to his username and things are fine up to here. (this page
> is not displayed, only for redirecting purposes).
> Step 3. On the personalized page, I check whether session is started,
> then display a welcome message with the username. Session variables
> are passed across pages fine.
>
> Next, I did exactly the same steps on server B; at step 2 (above) user
> is directed to the correct page. But when I get to step 3, the session
> seems to lose or set all its variables to NULL (I checked this using
> var_dump($_SESSION)).
>
> The codes on server A and B are identical. I copied the php.ini file
> from server A to B (just in case there were differences) and restarted
> Apache on server B. But still, session variables are lost in Step 3
> although the session is still running.
>
> Any ideas why?
>
I guess session_register causes the problem.
You should read the "Caution"-boxes on http://php.net/session_register.

 

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

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