I want to know if the following conditions will occur:
I have been browsing and other activities on the page, will the cookie be invalid during this period, or the login status will not drop. (In other words, the next request for a resource that requires the user to log in cannot be accessed.)
Do users have to be able to stay logged in when cookie exist?
Thank you for your answers first.
cookieYou can set the expiration time. If you don’t set the expiration time, the browser cookie will be cleared by default, so it is unlikely that you will lose the login status during the visit, unless the expiration time of this cookie is very short, but the normal development process will definitely not do this.
Whether the cookie has always been effective depends on the specific login logic. For example, some websites restrict multi-point login. You may log in at one place, and after logging in at another place, the original cookie will become invalid. There are many situations and specific analysis is required.