C# WCF AuthenticationService.IsLoggedIn问题

C# WCF AuthenticationService.IsLoggedIn问题,c#,asp.net,wcf,authentication,C#,Asp.net,Wcf,Authentication,我对身份验证例程使用单独的WCF AuthenticationService。方法:ValidateUser,Login返回true,所以看起来所有操作都正常,但当我在consume Login()方法之后调用IsLoggedIn()时,它返回false 授权服务设置: <?xml version="1.0"?> <configuration> <connectionStrings> <clear /> <

我对身份验证例程使用单独的WCF AuthenticationService。方法:ValidateUser,Login返回true,所以看起来所有操作都正常,但当我在consume Login()方法之后调用IsLoggedIn()时,它返回false

授权服务设置:

 <?xml version="1.0"?>
 <configuration>




    <connectionStrings>
     <clear />
    <add name="LocalMySqlServer" connectionString="server=192.168.0.7;Database=clients;       uid=clients;pwd=fetisova;persist security info=True;CharSet=utf8;         Use Procedure Bodies =false;" providerName="MySql.Data.MySqlClient" />
     </connectionStrings>


<system.web>
<machineKey validation="SHA1" />
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms" >
  <forms cookieless="UseCookies" />
</authentication>

<membership defaultProvider="MySQLMembershipProvider">
    <providers>
      <clear />
      <add name="MySQLMembershipProvider" 
           type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" 
           connectionStringName="LocalMySqlServer" 
           enablePasswordRetrieval="false" 
           enablePasswordReset="true" 
           requiresQuestionAndAnswer="false" 
           applicationName="Clients" 
           requiresUniqueEmail="false" 
           passwordFormat="Hashed" 
           maxInvalidPasswordAttempts="500" 
           minRequiredPasswordLength="3" 
           minRequiredNonalphanumericCharacters="0" 
           passwordAttemptWindow="10" 
           passwordStrengthRegularExpression="" />
    </providers>
  </membership>
  <roleManager defaultProvider="MySQLRoleProvider" enabled="true">
    <providers>
      <clear />
      <add name="MySQLRoleProvider" 
           connectionStringName="LocalMySqlServer" 
           applicationName="Clients" 
           type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </providers>
  </roleManager>
    </system.web>
   <system.web.extensions>
<scripting>
  <webServices>
    <authenticationService enabled="true"/>
  </webServices>
</scripting>
 </system.web.extensions>
 <system.serviceModel>
<services>
  <service name="System.Web.ApplicationServices.AuthenticationService"
      behaviorConfiguration="AuthenticationServiceTypeBehaviors">
    <endpoint contract=
    "System.Web.ApplicationServices.AuthenticationService"
      binding="basicHttpBinding"
      bindingConfiguration="userHttps"
      bindingNamespace="http://asp.net/ApplicationServices/v200"/>
  </service>
</services>
<bindings>
  <basicHttpBinding>
    <binding name="userHttps">
      <security mode="None" />
    </binding>
  </basicHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="AuthenticationServiceTypeBehaviors">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug
        httpHelpPageEnabled="true"
        includeExceptionDetailInFaults="true"
      />

    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment
  aspNetCompatibilityEnabled="true"/>


那怎么了?您能帮助我吗?

我应该在客户端设置allowCookie=“true”

为什么不改用User.Identity.IsAuthenticated?因为它是假的。我不在我的aspnet应用程序中验证用户身份。我使用单独的wcf服务(身份验证服务)来实现这一点。