Page 1 of 1
Session , Cookies , Request .........
Posted: Fri Jan 01, 2010 11:06 pm
by sagarpparakh
I am slightly confused with this words. As I am working on php dev. i know use of Get and post method but finding difficult to understand the accurate meaning of Session , Cookies and request on php Dev.
Any One Please can you explain this words .... Thanks in Advance ....
Re: Session , Cookies , Request .........
Posted: Sat Jan 02, 2010 12:54 am
by alex.barylski
SESSION persist for the duration of the application, once your browser closes (tyypically this can be changed) your session variables are destroyed. They are specific to individual user.
COOKIE persist similar to SESSION (again can be changed) but are stored on the client side as opposed to the server side, like SESSION. Cookies are limited in the amount of data they can persist, so most developers prefer session storage as the limit is far greater.
You would typically use both to store items for a shopping cart, etc which are saved until the user closes browser, checkout, etc.
Re: Session , Cookies , Request .........
Posted: Wed Jan 06, 2010 5:24 pm
by Jonah Bron
And request is just a super-global variable ($_SESSION) that has the contents of $_POST, $_GET, and, I think, $_COOKIE.
Re: Session , Cookies , Request .........
Posted: Sun Jan 24, 2010 10:35 pm
by sagarpparakh
Thanks .....
Re: Session , Cookies , Request .........
Posted: Mon Jan 25, 2010 12:03 am
by flying_circus
What Jonah said about $_REQUEST, and never use it! It does contain $_GET, $_POST, and $_COOKIE data, in some order. If $_GET, $_POST, or $_COOKIE contain the same-named variable, one will take precedence, and the other will be overwritten.