Aryan PrajapatKnowledge Contributor
What are the advantages and disadvantages of using session and cookies in PHP?
What are the advantages and disadvantages of using session and cookies in PHP?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
A session is a server-stored global variable. A unique id is assigned to each session and is used to retrieve saved values. When opposed to cookies, sessions have the ability to store a lot of data. When the browser is closed, the session values are automatically removed.
The example below demonstrates how to create a cookie in PHP.
The example below demonstrates how to start a session in PHP.