i have a confusion ...if textboxes shows the previous entered data in the browser..then what is the need to set the cookie in php. ..i know it is used to identify the user but what is main need of cookie???
Cookies are used to keep the used logged in constantly. Instead of having to log in on every page, their details are stored in a cookie which the site reads.
Sessions are stored on the server, cookies are stored on the visitor's computer. If you use sessions on a high traffic website, your server will run out of memory pretty quickly. Worth noting that since cookies can be seen by the user, you should make sure their data is encrypted.