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 in PHP by Kithuzzz
• 11,040 points
18 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,780 points
2,195 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,780 points
4,357 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 in PHP by Kichu
• 19,040 points
45 views
0 votes
0 answers

PHP | define() vs. const

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

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

PHP "php://input" vs $_POST

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

Jun 9 in PHP by Kichu
• 19,040 points
81 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 in PHP by narikkadan
• 18,480 points
37 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 in PHP by narikkadan
• 18,480 points
25 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 in Others by Aditya
• 7,660 points
1,585 views
0 votes
0 answers

PHP Unset Session Variable

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

Jun 9 in PHP by Kichu
• 19,040 points
178 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 in PHP by narikkadan
• 18,480 points
65 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP