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 call back method?

507


What do you use c# for?

486


Can we inherit singleton class in c#?

461


Why do we need indexer in c#?

535


Which is the base class in c#?

494






Is c# slower than java?

475


What is typeof c#?

514


Can a abstract class have a constructor?

458


Explain how can you clean up objects holding resources from within the code?

466


What is console readkey ()?

523


What is double c#?

524


What is parameters in c#?

492


What is difference between array and collection?

457


What is cts, clr?

429


What is the difference between int and int in c#?

488