Doubt on Session e Cookie

Hello everyone I have a doubt about the duration of a user’s login. I tried to set cookies for a few minutes but in the end, the user is always logged. From where I see the duration of the login? What does set the cookie?

Also, if a user accesses a page, I have to see if this is logged and that level has (admin user, etc.), for each page that I want to check a script that I have to implement controls?

i think you should hard code the default time of remember me…