currently im using session to log in the user. but when i close the browser and open it again i have to log in again. how do you keeo the user logged in in lets say 2 weeks.
Yes, you should do that using cookies. Here's the manual entry: http://php.net/manual/en/features.cookies.php
Alternately, you can take a look at this function: http://php.net/manual/en/function.session-set-cookie-params.php. It allows you to modify session cookie settings like its lifetime...