What are the uses of session and cookiee in php ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What are the uses of session and cookiee in php ?

2nd Apr 2018, 5:49 PM
Christian CK
Christian CK - avatar
3 Answers
+ 1
A session is a way to store information (in variables) to be used across multiple pages. session variables last until the user closes the browser.Session variables hold information about one single user, and are available to all pages in one application. A cookie is a small file that the server embeds on the user's computer. cookies stores small bit of information in name=value format. cookie stores frequently accessed information like usernames,form data... cookie the information is stored on the users computer.(client),while sessions are stored on servers.
2nd Apr 2018, 6:05 PM
Manorama
Manorama - avatar
+ 1
session is used to store user data throughout the session and will be stored in server side cookies are used store data in users computer for example cosider a e commerce website To have the particular user logged in throughout different pages user details are stored in sessions To store the cart items cookies can be used and the cart items can be populated when user logins again user secure information should be saved in sessions as it will be saved on server instead of local system as in cookies
2nd Apr 2018, 6:10 PM
kaliki chandu
kaliki chandu - avatar
+ 1
what are the methods used to remove session and cookies ?
3rd Apr 2018, 5:38 PM
Christian CK
Christian CK - avatar