Page 1 of 1

[solved]$_POST vs $_SESSION

Posted: Sat Jun 18, 2005 2:45 pm
by jslavin
Hello,

Was wondering if there is a big difference between $_POST and $_SESSION besides that $_SESSION variables can only be used when a session is initialized.

I'm running into some problems because I was using pure $_SESSION; however, some of my classes modify the globals, and since classes have to be included before a $_SESSION, i have a problem.

Will I loose any advantages from switching to $_POST for most of my globals?

Thanks in advance,
Jeff
jmslavin@hotmail.com

Posted: Sat Jun 18, 2005 2:49 pm
by John Cartwright
http://ca3.php.net/reserved.variables should answer your question

Posted: Sat Jun 18, 2005 3:01 pm
by senthilnayagam
maybe you should improve your coding and class

dont compare $_POST and $_SESSION, they are totaly different things and has its own purpose

if you suspect your session data get overwritten, go for locked session handlers

you can find one on http://www.phpclasses.org/browse/package/1840.html


regards
senthil

Posted: Mon Jun 20, 2005 3:02 am
by CoderGoblin
To summarize...

$_SESSION - Used to store information while a user is online, no matter where they are on the site.
$_POST - Used to pass information between individual files

[solved] $_POST vs $_SESSION

Posted: Mon Jun 20, 2005 3:15 am
by jslavin
thanks guys for all your help!