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

How cookies are trported from browsers to servers?

743


What is singleton class in php?

714


What is helper function?

695


What is polymorphism in php?

708


What will the ?getdate() function returns in PHP?

807


Explain the importance of the function htmlentities.

737


What is the use of pear in php?

736


How do you connet mysql database with php?

767


Which variable declarations within a class is invalid in php?

711


What is the use of explode() function?

792


Can we use get instead of post?

687


Which PHP function would you use to send an email?

780


Does php require a web server?

697


Explain the three different kinds of Arrays?

855


What is repository in php?

723