0

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

mahamed
  • 131
  • 3
  • 13
  • Keep distributed cache service on. it helps in caching security token resulting in faster response. – Vaibhav Mar 07 '16 at 06:55
  • it's already opened ....but i discovered that one of two front end server works fine but the other takes 30 second to authenticate . – mahamed Mar 15 '16 at 23:07

0 Answers0