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 syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)?
What is a destructor in c#?
What are the desktop applications?
What is a console device?
How do you escape a character?
How do you inherit a class into other class in c#?
Is c sharp and c# are same?
What is a predicate in c#?
Explain the difference between the system.array.copyto() and system.array.clone()?
What is a dictionary in c#?
How does foreach loop work in c#?
What is exe in c#?
What is type safe code?
What is method in c#?
What is an ienumerable in c#?