Session cookies expire within a certain time (mostly 20 minutes) for performance reasons.
That parameter is hardcoded, it is not changeable.
In regards to Autologin (which allows automatic authentication without requiring manual input of credentials, each time a user visits the site) the expiration date is also hardcoded - to 21 days. That parameter is also unchangeable.