Reply to basic session question

Your name:

Reply:


Posted by Marc E on 01/15/07 00:04

All,
I've read the docs on session handling but still can't figure this one
out. I'm guessing it's a setting in php.ini or something.
I've inherited this code from someone, and it's got a typical login/set
session/redirect. on the live server, it works fine. on my local computer,
it doesn't.

in the login script, the session is being created correctly, as print_r()
shows me. but when it redirects to the next page, I get "Undefined variable:
_SESSION" when i do a print_r on it. I've added session_start() to that
page, but then all I get is an empty session array.

Here's the pertinent chunk of code i inherited in the login page:

// Start the session, register the values & redirect.
session_name ('YourVisitID');
//ini_set ('session.use_cookies', 0);
session_start();
$_SESSION['first_name'] = $row[1];
$_SESSION['user_id'] = $row[0];
print_r($_SESSION);
//exit();
header ("Location: http://" . $root . "/photogallery/admin.php?" .
SID);
exit();


Any of this sound like a familiar problem?

Thanks a lot.

Marc

[Back to original 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

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