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


Please Help Members By Posting Answers For Below Questions

What are the __construct() and __destruct() methods in a php class?

498


Is uploaded file php?

531


What is isset in php?

517


What is factory pattern in php?

483


What are the 3 scope levels available in php and how would you define them?

501






Do you know how to get the ip address of the client?

509


How many different types of messages available in php?

535


What is difference Between PHP 5 and 7?

504


What is the difference between indexed and associative array?

494


Can we run php on tomcat server?

548


What is php oop?

501


What is strcmp?

506


How do I find environment variables?

496


Which framework is best for php?

494


What is the current stable version of php? What advance thing in php7?

504