|
INTERVIEW QUESTIONS
PROGRAMMING LANGUAGES
PHP
DETAILS
Question: What is the difference between Session and Cookie?
Answer: The main difference between sessions and cookies is that sessions are stored on the server, and cookies are stored on the user’s computers in the text file format. Cookies can not hold multiple variables,But Session can hold multiple variables.We can set expiry for a cookie,The session only remains active as long as the browser is open.Users do not have access to the data you stored in Session,Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity tracking
|
|
|
Category |
PHP Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7757 users |
Added on |
5/3/2016 |
Views |
70529 |
Rate it! |
|
|
Question:
What is the difference between Session and Cookie?
Answer:
The main difference between sessions and cookies is that sessions are stored on the server, and cookies are stored on the user’s computers in the text file format. Cookies can not hold multiple variables,But Session can hold multiple variables.We can set expiry for a cookie,The session only remains active as long as the browser is open.Users do not have access to the data you stored in Session,Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity tracking Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What are different types of Runtime Errors in PHP?
|
View Answer
|
|
Explain the "unlink" and "unset" functions.
|
View Answer
|
|
How can we encrypt the password using PHP?
|
View Answer
|
|
What does PEAR stands for?
|
View Answer
|
|
How can PHP and Javascript interact?
|
View Answer
|
|
What is the difference between mysql_fetch_object() and mysql_fetch_array()?
|
View Answer
|
|
How is the ternary conditional operator used in PHP?
|
View Answer
|
|
what is the difference between for and foreach?
|
View Answer
|
|
What is the difference between the functions strstr() and stristr()?
|
View Answer
|
|
What are the two main string operators?
|
View Answer
|
|
What does $_SERVER means?
|
View Answer
|
|
What is faster?
|
View Answer
|
|
How is it possible to cast types in PHP?
|
View Answer
|
|
What is the most convenient hashing method to be used to hash passwords?
|
View Answer
|
|
what is the static variable in function useful for?
|
View Answer
|
|
What does the function get_magic_quotes_gpc() means?
|
View Answer
|
|
How can we check the value of a given variable is alphanumeric?
|
View Answer
|
|
How can we connect to a MySQL database from a PHP script?
|
View Answer
|
|
What is a cookie , explaing by code ?
|
View Answer
|
|
What does the URI used as an XML namespace name point to?
|
View Answer
|