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
Can c# inherit multiple classes?
if we are updating a database using thread, and mean while application crashes or thread being aborted then what will happen in Database? Rollback or Database will be updated? Please explain with different scenario.
What is binding in c#?
What is the difference between static and constant variables?
Explain the process of inheriting a class into another class?
What are native functions?
What is a private class in c#?
What are the two kinds of properties in c#.
Will the following code compile and run?
What is the difference between an integer and int?
What issues can be faced while delivering code?
What are anonymous types in c#?
What is interface c#?
Why we need get set property in c#?
What will a loop recorder show?