Reply to General sessions question

Your name:

Reply:


Posted by tomb on 07/11/07 21:32

Every example I find on the web, and in the books I've purchased,
clearly explains how to setup a session handler for MySql, and usually
provides a very clear example of a main page that checks to see if a
particular $_SESSION value exists, and if not redirects to a login page
where the session is started, and the $_SESSION value is set. This is
great, makes perfect sense. But what about after that? What happens on
the next page the person goes to? What happens to the $_SESSION
values? Mine go away.

Is there somewhere to find what to do so that I can access the $_SESSION
values, and continue to validate this user is really allowed into the
next page?

I have in my php.ini the following:
session.save_handler="user"
session.use_only_cookies="1"
session.gc_maxlifetime="3600"

Then, I have an include file with this:
session_set_save_handler("sess_open", "sess_close", "sess_read",
"sess_write", "sess_destroy", "sess_gc");

session_start();

$sessid = session_id();
if(!$sessid)
die("Failed to start session");

The handlers are from one of my books and do make the entry into the
database when I login. After successful login, I am redirected to a
subdirectory to the index.php file there. That file includes my
database connection variables, and the sessions include file described
above. The $sessid variable has a value in it - it doesn't die. But my
$_SESSION object has no values in it at all. I'm obviously missing
something, but none of the instructors explain how to go beyond the
login page!

Please help.....


Tom

[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

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