Solution :-
Difference between Session and Cookies:-
Cookies can be understood as that piece of information that is stored on your system when you browse any website and this piece of information is sent by the websites you browsed while surfing on the internet. It is stored in the form of text files in your browser. The data or piece of information is not very huge and it get easily deleted after a predefined set timer or can be deleted by the user also. It is not much reliable and secure as that of a session.
Example of cookies: Whenever you browse a website than a cookie is provided to you from the side of the server it's like your unique identification number and whenever you browse that site again your browser will make the use of that cookie and give it to the site and the server of that site will came to know about your activities done so far. So a type of website activity tracking can be done through it.
A session can be thought of an exchange of information between a user and a system or between two or more systems which can communicate with each other through appropriate devices. The exchange is valid for certain period of time and the information is stored at the side of the server.The data or piece of information exchanged can very huge. Data will be present till the time browser interface is open.It is more reliable and secure compared to the cookies.
Example of Session: Whenever you visit a site of bank you get automatically log out from the portal after some time this happens because of session time set for an individual. It states that your session is expired kindly login again. It's all done from the security point of view.
Get Answers For Free
Most questions answered within 1 hours.