Same point :
Can solve the problem of HTTP stateless, so that the same client in the site to access multiple requests, you can save, set up information, and the request to establish a connection between things.
different points :
Simply say that the cookie information is saved on the client, and the session information is saved on the server side.
Session using key-value pairs, that is, the ID of the client, and the value placed on the server side, the user's ID to find the corresponding value on the server, this way value placed on the server side, there is a time limit, time to the server automatically recycle/release.
Cookies have two methods, one is to save the value in the browser variable, when the browser closes, the other way is saved on the hard disk, as long as the time is not enough, the next time can be used.
Contact :
When a client uses a cookie-based SessionID, SessionID is generally stored in a cookie.
Remark :
Cookies are shared between browsers of the same kernel, and different kernel browsers are not shared, such as Firefox and IE (where storage locations are different and of course not shared). Different kernel browsers cannot share cookies and can also produce different sessionid.
PHP Session control (learn about the difference between a cookie and a session)