What is the difference session and cookie in php? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

What is the difference session and cookie in php?

Implementation in coding

29th May 2019, 12:08 AM
‎‎‎
3 Answers
+ 8
Garuda in general session is created first during login when you can bound some time for login in seconds so that after that time if user hasn't done anything after login then the user session will end he was automatically out. This is an value of exit though used for security. I have created an example for login session just look over session code how it is created and if any query ping me I would love to help https://code.sololearn.com/whWP1D8uRl81/?ref=app Have some 🍎 🍎 🍎 🍎 🍎
29th May 2019, 2:30 AM
DishaAhuja
DishaAhuja - avatar
+ 8
a session only lasts until the browser is closed..then all in formation is destroyed. a cookie remembers certain things even if browser is closed so when they come back..it remembers info like login etc
29th May 2019, 1:56 AM
Jason Kennedy
+ 4
Session data is stored on server side and is deleted when the user closes the browser Cookies are stored on the users computer and can last for as long as you want
3rd Jun 2019, 4:03 PM
haydenki
haydenki - avatar