On SharePoint Server Subscription Edition, after the user session expires, on the first access to a site, the server responds with an error like below:
(I am able to make the exception go away by deleting the FedAuth1 cookie, but the error reappears next day at the first access to the site)
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
__Description:__An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. __Exception Details:__System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Stack Trace:
|[FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. ]
System.Convert.FromBase64_ComputeResultLength(Char* inputPtr, Int32 inputLength) +175
System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) +70
System.Convert.FromBase64String(String s) +45
Microsoft.SharePoint.IdentityModel.SPChunkedCookieHandlerV2.ReadCore(String name, HttpContext context) +226
System.IdentityModel.Services.SessionAuthenticationModule.TryReadSessionTokenFromCookie(SessionSecurityToken& sessionToken) +271
System.IdentityModel.Services.SessionAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs) +243
Microsoft.SharePoint.IdentityModel.SPSessionAuthenticationModuleV2.OnAuthenticateRequest(Object sender, EventArgs eventArgs) +415
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +209
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +182
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +94|
| -------- |
|[FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. ] System.Convert.FromBase64_ComputeResultLength(Char* inputPtr, Int32 inputLength) +175 System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) +70 System.Convert.FromBase64String(String s) +45 Microsoft.SharePoint.IdentityModel.SPChunkedCookieHandlerV2.ReadCore(String name, HttpContext context) +226 System.IdentityModel.Services.SessionAuthenticationModule.TryReadSessionTokenFromCookie(SessionSecurityToken& sessionToken) +271 System.IdentityModel.Services.SessionAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs) +243 Microsoft.SharePoint.IdentityModel.SPSessionAuthenticationModuleV2.OnAuthenticateRequest(Object sender, EventArgs eventArgs) +415 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +209 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +182 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +94|
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.9266.0