Login -- logout

I use Linux, php3  and postgresql.
I whant a user to enter a username and password every time he or she enters and reloads a page. I have found som code that autenticates ones, then he doesn't have to enter username and password until next time he or she start the web brouser again.

How can I make a page where one can login and logout?
Who is Participating?
j2Connect With a Mentor Commented:
You cant really do that. The browser has the final authority over that. You could try stuffing this in the HEAD of the page

<META HTTP-EQUIV="Expires" CONTENT="Fri, Jun 12 1981 08:20:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">

if that doesnt work, you can't do it. (without some kind of session management)
Hi svennykro,

You have two posibles way to do that:

a) Configure your Web server to restrict access to some directories.

b) Use PHPLib packages to manage session variables:

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.