Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8285439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:27:59+00:00 2026-06-08T11:27:59+00:00

I have a WPF client that is using WCF to call into a service

  • 0

I have a WPF client that is using WCF to call into a service hosted in IIS. My WCF client has AllowCookies=’true’ so that the forms authentication cookie that IIS is using is passed back and forth with each WCF call automatically. This all works just fine.

But I need the ability to clear out any forms authentication cookie my WCF client is caching so that my next request is not authenticated. Is there any way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:28:00+00:00Added an answer on June 8, 2026 at 11:28 am

    On wcf client, you would have access to

     HttpContext.Current.Request
    

    Now this Request object contains cookies. You could loop over the cookie collection and remove the one you need.

    foreach(var cookie in request.Cookies) { // }

    An excellent article at code project which explains cookie management on WCF client

    UPDATE

    HttpContext is only available at server side, so my previous answer was incorrect as pointed by Phil.

    The correct way to do it would be rather clumsy as you have get hold of HttpRequest itself

    MyWebServiceClient client = new MyWebServiceClient();
    
    
    using ( new OperationContextScope( client.InnerChannel ) )
    {
        HttpRequestMessageProperty request = new HttpRequestMessageProperty();
        //get the instance of your AuthCookie and make it blank
        request.Headers["AuthCookie"] = "";
    
        OperationContext.Current.OutgoingMessageProperties[
            HttpRequestMessageProperty.Name] = request;
    
        client.InvokeSomeMethod();
    }
    

    Found this example here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF client application that connects to IIS that hosts WCF Data
I'm hosting a WCF service in IIS 7.5 using .NET 4.0. I also have
I have a WPF application using service references to a WCF service. When doing
I am developing an application using WPF/MVVM. I have a WCF data service project
I have a problem. I have coded a wcf client (WPF and c#) that
I have a WPF application that is written using MVVM Prism. It has a
I have an internal WPF client application that accesses a database. The application is
I have a WPF application that I want to deploy to client PCs via
We have a C# client app that communicates to our C# backend service via
I have a WPF application which so far has been client only, but now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.