Putting a checkbox to remember the login info for passworded directories

Discussion in 'HTML & Website Design' started by Website_Playboy, Jan 7, 2013.

  1. #1
    I got the below code in my htaccess to restrict the directory.

    AuthName "Restricted Area" 
    AuthType Basic 
    AuthUserFile /home/content/75/9886475/html/folder/0234/.htpasswd
    AuthGroupFile /dev/null 
    require valid-user
    Code (markup):
    But when I go to the page, it doesnt ask to save the username and password also I dont know how long it saves the current credidentials.

    Is there anyway to put a checkbox to save the login info and maybe some time limit so It wont ask the login info again for that amount of time?
     
    Website_Playboy, Jan 7, 2013 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    The page the user uses to log in has nothing to do with the .htpasswd file. If you write login code for your site, you can save the login info as a cookie on the user's computer, including a time limit. This site gives you the information (and some code) you'll need to handle cookies.
     
    Rukbat, Jan 7, 2013 IP
  3. Website_Playboy

    Website_Playboy Member

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    I dont agree with you because i am talking about passworded directories through htaccess and htpasswd. So It has a lot to do with it. I also use the same system in my other website but somehow that one shows the option to save the user and pass in the pop up to access the page. I dont know what is the difference though.
     
    Website_Playboy, Jan 7, 2013 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    I've never tried to do what you want to do, because it's trivial to do as part of the site itself, but I suspect that the differences are in the Apache config file (which you normally don't have access to, which is why .htaccess exists). Why are you so opposed to doing it in your normal login page?
     
    Rukbat, Jan 8, 2013 IP