What is the difference between cookies and session?
Answer Posted / yogita mahajan
Cookies are some values saved in browsers for a particular website o publicly accessible
The purpose of cookies is to help websites to identify visitors and retrieve their saved preferences
Cookies are also used to facilitate auto login by persisting user id in a cookie save in user’s browser
Because cookies have been saved at client side, they do not create performance issues but may create security issues as they can be hacked from browser
Session variables are usually the most commonly used.
When a user visits a site, it’s sessions starts and when the user become idle or leave the site, the session ends.
Session variables should be used to save and retrive user specefic information required on multiple pages.
Session variables consumes server memory, so if your may have a huge amount visiters, use session very carefully and instead of put large values in it try to put IDs and references
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the usage of transponders?
What is the major difference between a custom control and user control?
Does c# have a 'throws' clause?
What is arraylist class in c#?
Define c# i/o classes?
What is .cs file in c#?
What is the difference between early binding and late binding in c#?
What is console readkey in vb net?
What is c sharp used for?
Can you store strings in arrays?
When Should You Call The Garbage Collector In .net?
What is CASPOL?
Can we overload indexer in c#?
What happens if a static constructor throws an exception?
What is literal control