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
How can we increase execution time of a php script?
Why do we show php code in browser?
Tell me what are magic methods?
What are the different data types in javascript?
Why namespace is used in php?
What is polymorphism in oop php?
Tell me what types of loops exist in php?
What is php trait?
How to register a variable in PHP session?
CWD is a type of shell variable. State Whether True or False?
List data types in PHP?
How to test if a variable is an array?
What are the encryption functions in php?
What is xss in php?
Explain what does $_server means?