Abstract
Chapter 11 showed you the principles of user authentication and sessions to password-protect parts of your web site, but the login scripts all relied on usernames and passwords stored in a CSV file. Keeping user details in a database is both more secure and more efficient. Instead of just storing a list of usernames and passwords, a database can store other details, such as first name, family name, email address, and so on. Databases also give you the option of using either hashing (one-way and irreversible) or encryption (two-way). In the first section of this chapter, we’ll examine the difference between the two. Then you’ll create registration and login scripts for both types of storage.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature
About this chapter
Cite this chapter
Powers, D. (2022). Authenticating Users with a Database. In: PHP 8 Solutions. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-7141-4_19
Download citation
DOI: https://doi.org/10.1007/978-1-4842-7141-4_19
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-7140-7
Online ISBN: 978-1-4842-7141-4
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)