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 is a constant defined in a PHP script?
What is "echo" in php?
iam mca post graduate in 2010 not getting job in JAVA so iam looking for carear in php as market demand is high so it is best option to try for php or not
How variables are passed through arguments?
What is the use of dual table in mysql?
How can cross site request forgery csrf be prevented?
Why is php used for web development?
What is the use of pear in php?
When is a conditional statement ended with endif?
What is use of htmlspecialchars php?
What is list function with their uses.
What is the use of htmlentities in php?
How many functions are there in php?
What are the new features in php 7?
Why does sql injection happen?