Re: session question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



#### ORIGINAL #####
I have an "index.php" page which does not user session_start(); command.
However in this "index.php" page, there are some $_SESSION['...']; variables
stored.

How is it possible that $_SESSION['...']; works even if no session has been
created before ?
moreover, if i use a print "Session ID : ".session_id(); after those lines,
session_id() is empty (which is logical) as no session_start(); command has
been used before.

So, how is it possible that $_SESSION['..'] works ?

Do i have a session created or not ?
#### END ORIGINAL ####


If you treat $_SESSION['username'] as a variable and set its value and
then print it or check it. It will display the value but value will
not be maintained for the next pages

e.g. for index.php you dont use session_start() but you do the follow

$_SESSION['username']="some value";
echo $_SESSION['username'];
//this will print "some value"

So, in your case it is possible that some page is being included that
is starting a session or setting up variable.


--
Regards
Fahad Pervaiz
www.ecommerce-xperts.com
(Shopping Cart Applications, Framework
for Multilingual Web Sites, Web Designs)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux