February 18, 20215 yr Hi there, I have built a site sith Vue.js and wanted to protect some pages with a password. From what I have seen, using .htaccess is a good method. But... Is there a (relatively) secure way when a user has entered the password they don't need to again for the rest of the visit? I was thinking storing a cookie or something, but is this easily hackable? Thanks
February 18, 20215 yr Everything is hackable. If you want to keep it secure you will need to block brute force attacks, cross server scripting and so on. You can use cookies to remember visitors but it’s not the best way. Far better to store login information in a database.
February 18, 20215 yr Author that is true the information is not sensitive in any way, more just a case of being able to block the average user. As the rest of the site does not use databases, I am wondering if there are any alternative methods to DB or cookies?
March 25, 20215 yr Hi there, Neither of .htaccess (or more correct name control files) nor Basic Auth are good enough when it comes to performance (.htaccess) or security (Basic Auth). Yes, they are easy to implement though. On the other hand Cookie(s) could be stolen easily, so they are no-no in a modern world. IMHO, OAuth2 will provide better level of security.
Create an account or sign in to comment