You are here: Sessions Problem « PHP Programming Language « IT news, forums, messages
Sessions Problem

Posted by lorenzdominic_ on 08/17/06 23:22

Hi
I am new to sessions and php and have been playing around with them -
and would like to know why this is happening?

Firstly I have a login page and it goes to a verify page which creates
a session like so:



>From verify.php-


ini_set("session.save_handler", "files");
session_save_path ("mywebsite.com/tmp");
session_name();
session_start();
session_register("user");

I then redirect to the users page like this:
$url= "Location:mypage.php";
header($url);
exit();


Once in mypage.php
I use the following session functions - I have to keep using the fist
two lines in my php pages which use sessions as it was requested by my
ISP:



>From mypage.php-


ini_set("session.save_handler", "files");
session_save_path ("mywebsite.com/tmp");
session_start();

Now comes the strange part or is it?
I can access the "user" variable which was registered by the verify
page. I do this WITHOUT any references to the correct Session ID as
follows:


print $user;


How is this possible?


My question is how does PHP know which Session ID is the correct one if

I have hundreds of users and I am not giving PHP the correct Session ID

just calling a variable from within a Session object?


Please help this is really weird and seems buggy??????????
Regards
Dominic

 

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

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