Q: which will give better performance while creating a website a session,cache,or cookie? I am creating a website,for that I need some kind of storage medium so which one can I use  and which one will give better performance to the website.


*

*session  

*cache     

*cookie  


please give your suggestions.

A: It all depends on the scenario and their usage.
Basically Caching is used to boost performance and Session is used to share data between multiple pages. Excess use of session bogs down the performance. Cookies are stored on client side and can be used to keep less confidential data on Client browser.
So you have to use all of them wisely to deliver performance

A: On whole this it depends on your need. 
session is a way to store variables stored in a session object so that it is accessible to all web pages hosted on the server for a user.
Cookies stored on client machine so not much safe to go for it unless variable are not so restricted.
Cache helps your browser go faster.Hence Caching is used to build high performance web applications.

A: *

*Session is used to store per-user information for the current Web session on the server.

*Cookie is used to store per-user information for the current Web session or persistent information on the client, so client has control over the contents of a cookie.

*Cache is shared between users in a single application. Its primary purpose is to cache data from a data store and should not be used as a primary storage. It supports automatic invalidation features.
If your application is used by a number of unauthenticated users, then it would be better to store the data in a cookie.If it requires authentication, you can store the data in the DB manually.

