What are the differences between session and cookie?
Answer / 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 |
How can I use the COM components in php?
1 Answers Covansys, Rushmore Consultancy,
What is the correct php command to use to catch any error messages within the code?
What are the string functions in php?
What is the best php framework 2018?
Which have the fastest execution between mysql_fetch_array() and mysql_fetch_assoc()
How can we get the browser properties using PHP?
4 Answers Google, Pollux Softech,
How to create the PHP Script to Calculate the Age Using the Inputs Of our Birth date and the Current date?
How can we submit a form without a submit button?
What does odbc do in context with php?
Explain the difference between isset() and empty()?
How can I execute a PHP script using command line?
Which php framework is best?