Cookies vs sessions

0 votes
A few months ago, I first used PHP. I researched cookies, sessions, and their distinctions in order to build a login system for my website (cookies are saved in the user's browser; sessions are stored on the server). I favored cookies back then (because who doesn't like cookies? he just said: "Who cares? I can't get a reasonable deal to keep it on my server "I, therefore, decided to use cookies for my bachelor's thesis project. However, after finishing the bulk of my software, I learned that sessions are more suitable in this specific scenario for keeping the user's ID. So I began to consider what I would respond if the jury asked me why I had chosen to utilize cookies rather than sessions. Just for that reason (that I do not need to store internal information about the user). Is it sufficient as an excuse? or is there more to it?
Could you kindly explain the benefits and drawbacks of utilizing cookies to store the user's ID?
Aug 8, 2022 in PHP by Kithuzzz
• 38,000 points
465 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

What is a Cookie? How to create Cookies With PHP?

A cookie is often used to identify ...READ MORE

answered Feb 13, 2020 in PHP by Niroj
• 82,840 points
3,791 views
0 votes
1 answer

How to delete all cookies of my website in php?

Hello @kartik, This will unset all of the ...READ MORE

answered Oct 27, 2020 in PHP by Niroj
• 82,840 points
9,016 views
0 votes
0 answers

php var_dump() vs print_r()

What is the difference between var_dump() and print_r() in terms of ...READ MORE

May 28, 2022 in PHP by Kichu
• 19,040 points
518 views
0 votes
0 answers

PHP | define() vs. const

In PHP, there are two ways to ...READ MORE

Jun 1, 2022 in PHP by Kichu
• 19,040 points
901 views
0 votes
0 answers

PHP "php://input" vs $_POST

I want to know what is the ...READ MORE

Jun 9, 2022 in PHP by Kichu
• 19,040 points
645 views
0 votes
0 answers

Using sessions & session variables in a PHP Login Script

I have created a login and register ...READ MORE

Jun 17, 2022 in PHP by narikkadan
• 63,600 points
621 views
0 votes
0 answers

What is the difference between Sessions and Cookies in PHP?

What is the distinction between Sessions and Cookies ...READ MORE

Jun 13, 2022 in PHP by narikkadan
• 63,600 points
399 views
0 votes
1 answer

"Cannot send session cache limiter - headers already sent"

The line "Headers already sent" means that ...READ MORE

answered Feb 18, 2022 in Others by Aditya
• 7,680 points
7,092 views
0 votes
0 answers

PHP Unset Session Variable

I am working on creating a product ...READ MORE

Jun 9, 2022 in PHP by Kichu
• 19,040 points
1,029 views
0 votes
0 answers

Why is PHP session_destroy() not working?

Why is session_destroy() not working? Is there any other way ...READ MORE

Jun 12, 2022 in PHP by narikkadan
• 63,600 points
1,357 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP