/    Sign up×
Community /Pin to ProfileBookmark

.htaccess Logout

Hi,

I am working with a .htaccess protected folder and looking for a way to include a logout link.

I searched over the web, but many people say it is impossible. Some say to use invalid URL to logout link, but that wont work with IE.

Whatever it is, you see we use .htaccess to logging cPanel, after login there is a logout link [url]https://domain.com:2083/logout/[/url] , theres https and port 2083. Is that a clue for a solution.

If anyone of you know a PHP based solution for this, please let me know.

Thanks and Best Regards

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@dbrandonNov 06.2008 — You can indeed do this in PHP, but it wouldn't be using htaccess for the HTTP auth. Instead PHP would take care of all of it.

You can find sample code here ...

http://uk.php.net/manual/sv/features.http-auth.php
Copy linkTweet thisAlerts:
@scragarNov 06.2008 — http://httpd.apache.org/docs/1.3/howto/auth.html#basicfaq

[B]How do I log out?[/B]

Since browsers first started implementing basic authentication, website administrators have wanted to know how to let the user log out. Since the browser caches the username and password with the authentication realm, as described earlier in this tutorial, this is not a function of the server configuration, but is a question of getting the browser to forget the credential information, so that the next time the resource is requested, the username and password must be supplied again. There are numerous situations in which this is desirable, such as when using a browser in a public location, and not wishing to leave the browser logged in, so that the next person can get into your bank account.

However, although this is perhaps the most frequently asked question about basic authentication, thus far none of the major browser manufacturers have seen this as being a desirable feature to put into their products.

Consequently, the answer to this question is, you can't. Sorry.[/quote]


Although PHPMyAdmin mimic's this pretty well:

http://php.net/features.http-auth
×

Success!

Help @GUIR spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...