Organizational Research By

Surprising Reserch Topic

Difference between Cookies and Session in PHP?



asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
27 views



Related Hot Questions

1 Answer

0 votes

Difference between Cookies and Session in PHP

Cookies are stored in the user’s browser memory.A cookie can keep information in the user's browser until deleted.
Session : logical object that allows you to preserve data across subsequent http requests.Whenever PHP creates a new session, it generates a session ID.
Session values are store in server side not in user’s machine. A session is available as long as the browser is opened. User couldn't be disabled the session. 
Cookies are stored in client side and sessions are stored in server side. 
Cookies can only store strings.We could store not only strings but also objects in session.
we could be save cookie for future reference, but session couldn't. When users close their browser, they also lost the session.
answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013

...