Pre Requisites Terminologies :
Cookies: - Cookies are small pieces of data that a server sends to a user's browser.
Well Cookies can be used for two primary purposes -
1) Authentication - Cookies track whether a user is logged in and under what name. They also streamline login information so users don't have to remember site passwords.
2) Store user preferences - Cookies are used to identify the user and their preferences
A Fed AUTH cookie is used with Claims Authentication. It contains references to the claims token. The Fed Auth cookie is for each top-level site in SharePoint , such as the root site, OneDrive, and the admin center.
The root Federation Authentication (rtFA) cookie is used across all of SharePoint. When a user visits a new top-level site or another company's page, the root Federation Authentication (rtFA) cookie is used to authenticate them silently without a prompt.
When a user signs out of SharePoint, the root Federation Authentication (rtFA) cookie is deleted.
Session & Persistent Cookies
The session cookie is a temporary cookie that stores user-specific information for a single visit to a website.
Well by default ,all the SharePoint cookies are session cookies and these cookies are not saved to the browser's cookie cache & when browser is closed it gets deleted.
Microsoft Entra ID provides a Keep Me Signed In button during login that passes a signal to Microsoft 365 to enable persistent cookies. These cookies are saved to the browser's cache and will persist even if the browser is closed or the computer is restarted.
A persistent cookie is a file that stores information about a user's preferences, settings, and sign-on credentials. These cookies remain on a user's device even after they close their browser.
They can be used to store information that can be accessed across multiple browsing sessions.
Persistent cookies have a huge impact on the sign-in experience by reducing the number of authentication prompts users see. Persistent cookies are also required for some SharePoint features, such as Mapped Drives and Open with Explorer.