Questions tagged [httpcookie]

A class in the System.Web namespace of the .NET framework which provides a type-safe way to create and manipulate individual HTTP cookies.

A class in the System.Web namespace of the .NET framework which provides a type-safe way to create and manipulate individual HTTP cookies.

409 questions
4
votes
1 answer

ASP.NET MVC 4 Cross-Subdomain Authentication. Can't sign out

So I have a site sitting on URL "mysite.com" and another site on "subdomain.mysite.com". User accounts are stored in "mysite.com", so when I need to log in on "subdomain.mysite.com" I take the user to "mysite.com", they enter their credentials…
4
votes
1 answer

How to manage cookies with HttpClient when using a mocking HttpMessageHandler

I have a unit test that calls into a class library by passing in HttpRequestMessage instances and receiving HttpResponseMessages instances back. It's very similar to testing a WebApi ApiController in this respect. The code I'm testing adds cookies…
Andrew Arnott
  • 80,040
  • 26
  • 132
  • 171
4
votes
3 answers

Client side Cache vs Cookie

What are the differences between Client side cache and cookie? I know cookie is a data structure. What about client side cache? Is this same with browser cache?
user1672097
  • 361
  • 1
  • 4
  • 12
4
votes
2 answers

Disable Cookie read/write in webbrowser c# application

I want websites to not able to read cookies or write new cookies in a webbrowser c# control application. I will prefer to disable all read/write cookies operation for all websites when the webbrowser c# application runs, if not then I have a list of…
Computer User
  • 2,839
  • 4
  • 47
  • 69
4
votes
1 answer

How to check if a cookie exists even if it was created in another application? (using JS or C#)

I have several applications and one of them is a central application that manages authentication, and where a LogOn page is imported from as an IFrame to the other applications. When the userName and password are correct, I create a cookie named…
ParPar
  • 7,355
  • 7
  • 43
  • 56
3
votes
2 answers

HttpPost with Header, Cookies, Parameters - 417 - Expectation Failed

Ok this will be a long one, so thx for all who are reading this to the end. Precondition: I can't access the server, I'm just trying to post data as a news comment. I'm desperately testing this out for a couple of hours now but I still don't have…
einschnaehkeee
  • 1,858
  • 2
  • 17
  • 20
3
votes
2 answers

Will SameSite=None cookie be deprecated in the future?

I am creating a feature that will heavily depend upon cookies with SameSite=None and secure flag set to true as described in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite Cookies with SameSite=None must now also…
3
votes
2 answers

how to generate a cookie in text file

I'm wondering if it's possible to generate a cookie and save it in a text file. The requirement is to generate a cookie for any domain not only that you own. After all the cookies are plain text but the "space" and path ("/") seems to make it a bit…
Michael
  • 6,377
  • 14
  • 59
  • 91
3
votes
0 answers

SameSite attribute not set for .AspNet.Cookies

I am working on an ASP.NET application. I'm trying to set the samesite attribute to "Lax", but it is still showing as blank. This is what I have tried so far: Upgraded .Net framework to v4.7.2 from v4.6 Set samesite in httpcookies in web.config -…
Animesh
  • 31
  • 1
3
votes
1 answer

How to set HttpCookie Samesite attribute in .Net framework 4.0.30319?

I'm currently using .Net framework 4.0 in my application. Upon checking i could see that the samesite attribute is available only from .Net framework 4.7.2…
3
votes
2 answers

C# SameSite flag issue

As Chrome is going to make the SameSite=None and Secure flag mandatory from 80 version on 4th Feb, I am try to set this flags in my cookie using the following lines of code: HttpCookie myCookie = new HttpCookie("XYZ"); myCookie.Value =…
krunal maniar
  • 31
  • 1
  • 4
3
votes
0 answers

Seemingly random disappearance of cookie predominantly in Edge

Environment I can reliably reproduce in Edge 18 Edge 44.17763.1.0 I have also observed the same failure but less frequently in other browsers. We use bugsnag to track these type of errors and see the browser breakdown as: Behaviour Every now and…
David
  • 7,652
  • 21
  • 60
  • 98
3
votes
3 answers

Server cannot modify cookies after HTTP headers have been sent

I am creating a web application in C#. When my page loads I fire an asynchronous thread to process some data. Part of this processing is the updating of a cookie. However when I save the cookie to the response by…
amateur
  • 43,371
  • 65
  • 192
  • 320
3
votes
0 answers

How to secure and validate _fbp cookie

I am running a Netsparker scan on my site and it has raised an issue regarding the _fbp (Facebook) cookie - not being Secure and not marked as HttpOnly. The code that Facebook has supplied which needs to go in the HEAD is: