Jump to content

.htpassword password expiration?

Mornincupofhate

So I'm working on an automated subscription system, and I have the passwords and authentication working and everything, but is there a way to make the certain credentials expire after a certain amount of time? 

Link to comment
Share on other sites

Link to post
Share on other sites

It's not easy since the htaccess stuff is cached by the client. One method is to use the expires meta tag, however this will forgo caching on the entire site, meaning your script and images files will also be not cached

 

<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">

 

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Hazy125 said:

It's not easy since the htaccess stuff is cached by the client. One method is to use the expires meta tag, however this will forgo caching on the entire site, meaning your script and images files will also be not cached

 


<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">

 

Literally have never touched .htaccess before besides today.

Mind telling me where to put this?

Link to comment
Share on other sites

Link to post
Share on other sites

I don't blame you. htaccess does my head in, meta tags go in a HTML document 

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Hazy125 said:

I don't blame you. htaccess does my head in, meta tags go in a HTML document 

Thanks, but still confused.

If I'm going to have multiple username/password sets for multiple people, how would I set this up?

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Hazy125 said:

I don't blame you. htaccess does my head in, meta tags go in a HTML document 

Just to make sure we're on the same page, we're talking about removing the username/password fully from the .htpasswd file after a given time, and not just cookie expiration, correct?

Link to comment
Share on other sites

Link to post
Share on other sites

Yeah, the problem is that you can't actually reliably do it. Forcing a browser cache clear will work. So, you would put that meta tag on the page that is shown upon HTTP authentication. You might also have success by directing the user to fakeusernamethatnoonewillhave@yourdomain.com but that isn't supported and can produce errors on some browsers 

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Hazy125 said:

Yeah, the problem is that you can't actually reliably do it. Forcing a browser cache clear will work. So, you would put that meta tag on the page that is shown upon HTTP authentication. You might also have success by directing the user to fakeusernamethatnoonewillhave@yourdomain.com but that isn't supported and can produce errors on some browsers 

Damn, I suppose I would have more luck having someone write me a php program that automatically rewrites the file every x days?

Link to comment
Share on other sites

Link to post
Share on other sites

I would suggest using a typical PHP based login system unless you absolutely need to login via HTTP... 

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×