You are here: Re: Session Variables Lost - Help « PHP Programming Language « IT news, forums, messages
Re: Session Variables Lost - Help

Posted by Rik Wasmus on 09/01/07 03:35

On Fri, 31 Aug 2007 15:58:43 +0200, Eddie <eddieandrews@gmail.com> wrote=
:

> I am having difficulty in setting variables in a session, and then
> accessing those variables throughout the web pages that they click
> on. After having them set a user name and password, successfully
> authenticating against Active Directory, I send them from the
> login.php page to the index.php page. But when I get to the index.php=

> page, the session ID is visible, but the session variables and values
> are not. Can you help me out? Also, I'm curious how to distinguish
> between various sessions if multiple ones are available.

Multiple sessions in a single request are not really supported using =

'normal' PHP. It is theoretically possible, but it would require a lot o=
f =

tinkering, and normally wouldn't be something you want.

> -- excerpt of login.php page
>
> start_session();
>
> $user=3D $_POST[u];
> $pass=3D $_POST[p];
>
> if (isset($_SESSION[user]) and ($_SESSION[user]=3D=3D$user)){

How does $_SESSION['user'] (mind the quotes as indicated earlier) get se=
t =

_before_ this if statement? In these excerpts it will not be set anywher=
e, =

so all the code in the if statement will not run?

>
> $_SESSION[auth] =3D admin_all;
> $_SESSION[user] =3D $user;
> $_SESSION[timelast] =3D time();
> $_SESSION[email] =3D 'testemail@testdomain.com';
>
> header('Location: http://mydomain.com/index.php');
> }
>
> but when I go to the on to the index.php page, I cannot see the
> results. What am I missing?

Heed Erwin's advice about error_reporting(E_ALL); (and possibly an =

ini_set('display_errors',true); If these are true excerpts there are mor=
e =

problems then just the carrying on of a session.
-- =

Rik Wasmus

My new ISP's newsserver sucks. Anyone recommend a good one? Paying for =

quality is certainly an option.

 

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

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