What is the difference between cookies and session?

Answer Posted / kayal

The main difference between cookies and sessions is that cookies are stored in the user's browser, and sessions are not. A cookie can keep information in the user's browser until deleted. Sessions work instead like a token allowing access and passing information while the user has their browser open. The problem with sessions is that when you close your browser you also lose the session. I have read the very good post on cookies and sessions with suitable php code.You can see that on
http://cs-pages.blogspot.com/2011/05/difference-between-cookies-and-sessions.html

Is This Answer Correct ?    12 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between Singleton design pattern and Factory design pattern?

554


What are access modifiers used for?

597


Write a program in C# for checking a given number is PRIME or not.

632


What is CASPOL?

609


What is the C# syntax to catch any possible exception?

528






Is null empty or whitespace c#?

503


What is a Managed Code??

541


What are the advantages of using partial classes?

531


Is php better than c#?

497


How is the syntax written to inherit from a class in C#?Give an example ?

541


What is delimiter in c#?

481


What is the difference between double and decimal in c#?

458


What do you mean by “finalize” and “finally” methods in c#?

485


Is there an equivalent of exit() for quitting a c# .net application?

493


Is predicate a functional interface?

487