What is the different between cookies and session in php?
Answer Posted / jeet
1. Session Stored data at server and session_id (PHPSESSID)
at client side(browser). Cookies stored data at client
side(browser) and each time the same computer requests a
page, it will send the cookie too.
2. Sessions are more secured than cookies as data stored at
server side.
3. Sessions can not be blocked by user from browser while
cookies can be.
4. For login Sessions fail as data is served by multiple
servers ( absence of load balancing ) while cookies do not
as stored at cliet.
5. Sessions amount of data to be stored is NOT LIMITED.
Cookies amount of data to be stored is LIMITED.
6. Sessions can store OBJECTS. Cookies can only store STRINGS.
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
Tell me how do you define a constant?
What is use of echo in php?
Is php a backend?
How to get elements in reverse order of an array in php?
What’s the special meaning of __sleep and __wakeup?
Explain how can php and javascript interact?
How to invoke a user function?
How to create a text file in PHP?
What is magic quotes?
Which function would you use to replace a record in a database in php?
Tell me whether it is possible to share a single instance of a memcache between multiple php projects?
How many types of arrays are there in php?
What is list in PHP?
What is php call function?
List types of array are available in php?