What is the main difference between a session and a cookie in PHP?

  • Session data is stored on the server
  • Cookies are stored on the client-side
  • Session data expires when the browser is closed
  • Cookies store data that is encrypted
The key difference between sessions and cookies in PHP is that session data is stored on the server, while cookies are stored on the client-side. This has important implications for data security and persistence.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *