my tools are php and mysql.
i want users to be able to log in to a preregistered account. they whould be able to autologin after the first time.
how do i make an optimal login function, how do i keep it secure and prevent users from logging into others accounts?
also, how do i keep the users logged in between reloads?
how is it usually done? do websites save username and password in a $_COOKIE locally on users machine? is this cookie matched between each reload or is it better to use $_SESSION? and if sessions should be used, is it better to use "cookie" sessions or "url" sessions?
all tips on security and ease of use is welcome. my users will have an ID, username and password. IDs and usernames are unique (no two users can have the same one).
thank you
