why SharePoint 2013 takes too much time to authenticate for both windows and forms authentication for the first time?

134 Views Asked by At

I have made a SharePoint 2013 internet site, it's works fine and loads quickly but when i login for the first time ,it takes about 30 second to authenticate for both windows and forms

i have traced the following forms authntication code

   private static bool EstablishSessionWithToken(SecurityToken securityToken)
    {
        if (null == securityToken)
        {
            return false;
        }

        SPFederationAuthenticationModule fam = SPFederationAuthenticationModule.Current;

        if (null == fam)
        {
            return false;
        }

        fam.SetPrincipalAndWriteSessionToken(securityToken, SPSessionTokenWriteType.WritePersistentCookie);

        return true;
    }

no exception occurred but specfically it takes 30 seconds at this line

  fam.SetPrincipalAndWriteSessionToken(securityToken, SPSessionTokenWriteType.WritePersistentCookie);

after i login successfully ,the next login will be fine and quickly
this problem happened again after one hour or more

i have checked the share point LOGS files but couldn't find any information related to that

0

There are 0 best solutions below