'Remember me' function instead of long life session

'session_set_cookie_params' does not work on the most systeme, because the session can not live longer than it is globally configurated in the php.ini. Mostly 24 min.

So I thought a 'remember me' function like on Amazon or Facebook would be better.

I added a checkbox to the login screen to indicate that the user wants to stay logged in, even if the session times out.
A cookie will be created to recognize the user for one year or until the user logs out manually via the logout button.
The cookie is a sha512 hash made of salt, password and username.