SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict jlisec01's Avatar
    Join Date
    Nov 2006
    Location
    MI
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    logging off using cgi???

    Hi there, I was wondering if there was a script that to logg a user off? Im using apache and I set the directory to allow a username and password, and since apache doesn't allow to log off unless you close your browser or something, what could I do to have a link when click would run the script to log the person off? thanks for any help.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    No. HTTP basic authentication involves the browser sending the encrypted username and password with each request. There is no actual state, no "logged in" and "logged out" status. The user becomes "logged out" after closing the browser simply because the browser stops remembering the username/password that was provided to send with each request. So there is nothing server-side you can do to log someone out, short of deleting their access entirely.

    Now if you program your own authentication scheme using sessions or cookies rather than HTTP authentication, you can delete the session to log the user out.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •