Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Password Protect Pages Using HTACCESS

Featured Replies

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

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.

  • 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?

  • 1 month later...

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.