adspace


What are the differences between session and cookie?

Answer Posted / Laeek Ahmad

PHP Sessions and Cookies are both used for storing data temporarily, but they have some key differences:
1. Storage: Sessions are stored on the server, while cookies are stored on the client's browser.
2. Data Lifetime: Sessions typically last until the user logs out or the browser is closed, while cookies can persist for a longer duration depending on their settings.
3. Security: Sessions are more secure because data isn't sent to the client, whereas cookie data is sent with each request.
4. Session ID: Each session is identified by a unique session ID, which is stored in a cookie or URL parameter, while cookies can be used to store arbitrary data.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me what kind of things have you done on the social side?

1067


How to calculate the difference between two dates using php?

1147


Write a program using while loop?

1122


sort term descripttion form, report and uery

2254


if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer

1994


What is the current stable version of php?

1126


What is trait in php?

1068


What does $_files means?

1166


What is the difference between htmlentities() and htmlspecialchars()?

1094


How to create a web form?

1113


Name and explain five of the PHP error constants?

1039


What is the current stable version of php? What advance thing in php7?

1095


How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain

1080


Which variable declarations within a class is invalid in php?

1050


What is difference between static and final in php?

1109