Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed PHP User Authentication!
You have completed PHP User Authentication!
Preview
Cookies vs Sessions is an ongoing debate. We will explain what the difference is between the two and when you would use one over the other.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
The debate is, should you store
your details in cookies or session?
0:00
Although there is no 100% correct answer
for this debate, I'm going to go over
0:01
the differences between both, with
the positives and negatives of each one.
0:06
A lot of people will
argue that using sessions
0:11
is the correct way of storing
information about the user.
0:14
The reason I get from a lot of people
when asking this is that it's easy.
0:17
Although this argument is true,
it's also easy for
0:22
a hacker to gain access to the same
session for cross site scripting.
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up