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
What is cookie in php with example?
How many data types are there in php?
How does php serialize work?
What is new keyword in php?
What are the advantages of stored procedures?
What are magic constants in php?
What is mean by an associative array?
For image work which library is used in php?
Explain how to run the interactive php shell from the command line interface?
Tell me are parent constructors called implicitly inside a class constructor?
What are the uses of implode() function?
What are the advantages of triggers?
What is the difference between the functions strstr() and stristr()?
Tell me what is the difference between the functions strstr() and stristr()?
What percentage of websites use php?