• support@answerspoint.com

What is difference between session and cookie in php?

1815

Hi I would like to know the difference between a php session and a cookie

  • PHP

  • asked 8 years ago
  • G John

3Answer


0

The main difference being that session data is stored on the server, while cookie data is stored on the client. Therefore, a client can easily modify the cookie contents, but will have to work way harder to modify the session contents.

  • answered 8 years ago
  • G John

0

Cookies are a means to store information in the end-user's browser, so that the server can track the end-user.

Sessions are also implemented by using cookies, but the actual data is not in the browser; rather, it is stored in the user's session record on the server. In the case of sessions, cookies are used to identify a particular end-user's session identifier on the server records. Hence, they are a more secure way of storing user information.

  • answered 8 years ago
  • Gul Hafiz

0

There are session and Cookies, both are used to store values or data. But there are some key differences between session and cookie: a cookie stores the data in your browser and a session is stored on the server. Cookie data is available in your browser up to expiration date and session data available for the browser run, after closing the browser we will lose the session information.

  • answered 8 years ago
  • Gul Hafiz

Your Answer

    Facebook Share        
       
  • asked 8 years ago
  • viewed 1815 times
  • active 8 years ago

Best Rated Questions