You are viewing our Forum Archives. To view or take place in current topics click here.
HTML Access Help +REP
Posted:

HTML Access Help +REPPosted:

CrypTic_Trivia
  • Resident Elite
Status: Offline
Joined: Jan 12, 201410Year Member
Posts: 299
Reputation Power: 12
Status: Offline
Joined: Jan 12, 201410Year Member
Posts: 299
Reputation Power: 12
I have a HTML website which has a password protection so the user can not access the site unless the correct password is entered, I am wanting to make it where the user inputs a password and the user gains access to the site for a specific amount of time, like a week then after that week it then asks for another password.
As soon as the first password is entered that password is no longer usable but the user still has access to the site, so only that user has access for that week any help?

thanks +REP
#2. Posted:
-Deano
  • Rated Awesome
Status: Offline
Joined: Aug 19, 201014Year Member
Posts: 5,243
Reputation Power: 532
Status: Offline
Joined: Aug 19, 201014Year Member
Posts: 5,243
Reputation Power: 532
When you have a user logging into your website, you can create an entry in your database that stores their login time.
When they try to access your site, you can check if the time was over a week ago, if it was then you can deny them access.
#3. Posted:
CrypTic_Trivia
  • Resident Elite
Status: Offline
Joined: Jan 12, 201410Year Member
Posts: 299
Reputation Power: 12
Status: Offline
Joined: Jan 12, 201410Year Member
Posts: 299
Reputation Power: 12
-Deano wrote When you have a user logging into your website, you can create an entry in your database that stores their login time.
When they try to access your site, you can check if the time was over a week ago, if it was then you can deny them access.


I'm trying to make it so the user that is vising the site cant give out any sort of password or details so its just that one person that can access the site, with that they can give their details to another person to use
#4. Posted:
ProJimmyRustler
  • V5 Launch
Status: Offline
Joined: Jul 14, 201410Year Member
Posts: 1,720
Reputation Power: 71
Status: Offline
Joined: Jul 14, 201410Year Member
Posts: 1,720
Reputation Power: 71
CrypTic_Trivia wrote
-Deano wrote When you have a user logging into your website, you can create an entry in your database that stores their login time.
When they try to access your site, you can check if the time was over a week ago, if it was then you can deny them access.


I'm trying to make it so the user that is vising the site cant give out any sort of password or details so its just that one person that can access the site, with that they can give their details to another person to use

From what it sounds like, you may want to try using persistent cookies.
A cookie (called an Internet or Web cookie) is the term given to describe a type of message that is given to a Web browser by a Web server. The main purpose of a cookie is to identify users and possibly prepare customized Web pages or to save site login information for you.

Source: [ Register or Signin to view external links. ]


I don't have any experience to give an exact suggestion, but this seems to be what you are looking for. A persistent cookie has two main things that you are looking for: User identification and an expiration date.
You could use this to store the user information that you want, such as whether a unique password has been used (You would more than likely need a database for this) and have it to where that user gets signed out after X amount of days.

W3schools as a decent tutorial on how to use cookies with javascript.

Another solution would be to have a mix of cookies, user accounts, and a database.
You would give the user a one time code to sign in. This code is checked with a database and if it is correct, then some code creates a unique user id, a password, and stores the date. This password is stored to a persistent cookie and never showed to the user. When the user tries to access the site in their time frame, they wouldn't need to sign in because of the cookie (granted you would need to do some more coding to get this to happen). Then you need a PHP (or what ever else you want to use) script that checks the date when the user accesses the site. If the date is fine then they get to sign in. Else wise the cookie will be expired and not exist.

I'm not sure what you are doing as far as the content for your website, but I think you need to have a more flushed out solution if you are going for security. These cookies can be edited/recreated and if the file becomes unusable the user can't access the site again.

Stack overflow has a good post about how this is kind of a futile effort, because the user experience is at risk of being effected.
Source: [ Register or Signin to view external links. ]
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.