webForumDet fria alternativet

Använder htpasswd. Kan man logga ut?

Webbutveckling

2 svar · 378 visningar · startad av Danne V

Medlem sedan aug. 20068 090 inlägg
Frågan#1

Använder *nix, Free BSD och htpassword (via Cpanel) för att skydda några foldrar.

Dilemmat är att kakan och/eller sessionen är öppen ganska länge. Folk som använder samma dator efter mig har även dom access ganska länge. Vet nån hur man kan logga ut, eller korta ner sessionen?

Har förstås skickat in en support-ticket till hotellet, men postar här ändå ifall nån vet nåt knep...

Medlem sedan dec. 20051 420 inlägg
#2

Hittade detta på the interwebs.. kanske värt att testa..

One trick that works on most browsers I've tried it with is to make the person go to a part of th site for which they are not authorized.

For instance, make a directory "/logout" and make the .htaccess there use a different file of usernames and passwords. If your user goes there, they will get asked for a username/password, but when they try theirs, they will get denied. This makes the browser forget the password. Your auth denied page for this directory should be something like "You have been logged out".

It's pretty crude, and somewhat confusing, but there aren't many other alternatives. That's one reason not a lot of people use basic auth such as with .htaccess.

Här hittade jag en guide med flera olika sätt (y)

Medlem sedan aug. 20068 090 inlägg
#3

Tack!

265 ms totalt · 4 externa anrop · v20260731065814-full.6fe65c25
122 ms — deklarationer (db)
0 ms — hämta statistik (cache)
140 ms — hämta tråd, inlägg och bilagor (db)
121 ms — ändringar (db)