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 are the __construct() and __destruct() methods in a php class?
Is uploaded file php?
What is isset in php?
What is factory pattern in php?
What are the 3 scope levels available in php and how would you define them?
Do you know how to get the ip address of the client?
How many different types of messages available in php?
What is difference Between PHP 5 and 7?
What is the difference between indexed and associative array?
Can we run php on tomcat server?
What is php oop?
What is strcmp?
How do I find environment variables?
Which framework is best for php?
What is the current stable version of php? What advance thing in php7?