loader spinner

Differences between Session and Cookies in PHP

June 19, 2019 1:25pm - 1 min read

Last updated on: December 01, 2019 1:48pm

What are the difference between Session and Cookies in PHP?

Session Cookies
Data are stored on the server. Cookies Data are stored on client-side or user’s browser.
Session data are more secured as they never travel on every HTTP request. Cookies data are less secured as they are travel with each and every HTTP request.
You can store the objects in session ( Store large amount of data ). You can store only string type of data in cookies ( Max file size is 4kb ).
The session cannot be used for future references. Cookies are mostly used for future references.
Last updated on: December 01, 2019 1:48pm