Chrome Latest version will not clear cookies ASP.NET - asp.net

I have an ASP.NET web form application using 4.5.2 framework. Chrome's latest update seems to eliminated the ability for my application to clear the cookies. I know the SameSite attribute can be added to framework versions 4.7.2 and greater but I am not having any luck finding anything that works for older versions. Does anyone have a simple solution to bring back clearing cookies so my application will work correctly? What are my options around this? I've tried adding rewrite rules in my config, but didnt have any luck with that. Any help is appreciated.

If you are using Visual Studio 17 or 19 after you have enabled debugging of Web Apps directly on browser (as image shows from Settings→Debug→General→ Enable debugging of Javascript on browsers …… of ASP.Net pages) then you when select Chrome as Browser to test your Web-App ASP.NET the only thing to do every time you need to restart without cookies o browser history related to your Web-App is:
Right click on Refresh arrow → “Clear Cache and restart/reload manually” (as image below shows)

Related

Site displays different when debugging in VS2012 with IE and when in production

I'm working on a asp.net project that is a responsive website so it can be viewed on mobile and tablets. When running the project the site opens in IE 11 and looks great. When I publish the site and open it with IE 11 the div that holds the main content is dropped to the next line.
What am I missing to publish or set to have this correct? Thank you
If you're developing on ASP.net you might be using IIS, such is a web server which I don't know a lot about.
My idea is that you are probably missing configuration changes from development to production mode of your web server.
Hope it will point you to the right direction.
I found the steps to find the answer here:
Div displays differently in IE and Chrome
I went into the developer tools and Console and there it said that it was being displayed in Compatibility View. I checked the settings and sure enough the url was listed. I removed it and refreshed and everything is looking good.

Asp.Net - Internet Explorer 10 - Javascript removed from page unless in Compatibility Mode

I have a website built using Visual Studio 2010 (may have been upgraded), running with .Net 3.5 SP1 in Dev and on the Web Server.
When I go to my Login page, in development or on my test server, I can login just fine. The login page depends on a few pieces of auto generated JavaScript code I can only assume are created at runtime by Asp.Net.
One being a JavaScript method called __doPostBack(eventTarget, eventArgument).
When I go to my Login page on my Production Server, the login page doesn't work any more. What I've found is that all of the JavaScript I have in the page Is suddenly gone.
I am also missing a lot of ASP generated hidden input elements. Like,
__LASTFOCUS
__EVENTTARGET
__EVENTARGUMENT
__VIEWSTATEGENERATOR
Now if I enable Compatibility Mode, it all comes right back and works just fine. View Source show's my JavaScript is back and the missing ASP generated input elements are back as well.
Anyone ever seen this?
I did read the article about this being a common issue due to ASP.Net not recognizing IE 10 as a valid browser. Bug and Fix: ASP.Net fails to detect IE10 causing _doPostBack.... is the article I'm referring to.
I find it strange that the KB's this article points to show much later time stamps on the ie.browser files than what I have on my development machine. My machine shows my ie.browser file was created and last modified in 2009. However the KB's show that if I have a good ie.browser file, the timestamp should be Aug 31 2011. So I don't really know why I'm not having this problem on my development machine.

Safari, ASP.NET 4, and LinkButton

I have an ASP.NET Web Application using .NET Framework 4 and it is working fine on all browser when I test it locally using my Visual Studio Pro 2010, but when we deploy it to our server (IIS7 on Windows Server 2008 R2), the LinkButtons of my Web Application is not working correctly on Safari Browser on all platforms.
What was happening was when the LinkButton has a function that uses Response.Redirect, it somewhat clears the session or doesn't save it. I can check this since when I redirect to another page, I save the values inputted to a session first before redirecting, and validate it to the redirected page and if there's no session, bring it back to the previous page.
I have already implemented this fix to add a .browser file to my webapp but it doesn't fix my problem. I also tried this answer from SO to add a Page_PreInit and a configuration but to no avail.
My IIS Configuration has enabled for both Session and Cookies, and I honestly do not see why it will only affect Safari Browser if it is a server configuration error.
I've been working on this bug for a whole day and I can't still fix this. Please help, thanks in advance.
Update: I forgot to mention that my website is inside an iframe, after researching further I have found this question that says that Safari doesn't allow Third-Party Cookie by default. Now I can't use the said fix since my application is in ASP.NET not in PHP.

ASP.NET webforms app sometimes fails to load until cookies deleted

I'm developing an ASP.NET 4 webforms app on my Windows 7 PC. I'm running VS2010 and IIS7.5.
I have a weird problem where after a few page loads (anywhere from 1 to 20ish) I get NO response from IIS. I can't even hit a breakpoint in Application BeginRequest, I just get nothing. But, if I delete all cookies from the browser for the development domain, the website will load perfectly again for a few more requests.
This happens in all browsers I have installed (IE9, Firefox, Chrome, Safari, Opera).
However, if I deploy the app to our hosted server, all works fine.
Anyone had this issue before?
Many thanks for any help you can provide.
After the comments I add for reference here an answer.
This is an issue when you place too large cookie to the browser and browser can not handle them.
The reason that is play here, not play there maybe because of the data that you have type on it and save on cookies.
You can search for cookie limits on the internet and for different browsers. For ie for example http://support.microsoft.com/kb/306070
Try to keep the cookie size as low as you can.
From antmx
For reference, here is what I changed in web.config to fix this problem.
<roleManager cacheRolesInCookie="false" />
Note, though, that now a user's roles will be read from the database each time they're needed, which could cause a performance issue. (I am not think that there is any performance issue and is more secure this way)

Authentication dialog when running with Visual Studio web server

When using Visual Studio's built in web server, every time I make a page request the standard login box pops up and asks for credentials. It doesn't work if I actually put in my credentials, so I just have to hit cancel 5 times so it will go away.
When I run the application through IIS (locally or on test server) it works just fine (no login box comes up).
Anyone know how to fix this or have any idea what might be causing it?
I assume you mean JavaScript alert box-looking login dialog, right? This dialog pops up when you make a request to a portion of website where anonymous access is disabled from IIS. It is different from ASP.NET authentication.
Do you have some portion of web site protected? Or are you making any HTTP request to external sites, like images and etc?
If your page looks ok after hitting cancel multiple times, it must be one of those HTTP request to protected file like images, css, js or whatever.
I'd look in Fiddler or Firebug to see if any request is failed when you hit cancel in that login dialog.
I'd also try clearing cache/authenticated session on the page that runs on IIS to see if it actually shows you that login dialog.
I had this same issue. However, my solution was different and the issue seemed different as well.
I had been working on a ASP.NET 2.0 web application, using VS 2008. Everything was working fine with the built-in IIS server. I hadn't opened this project for about a week and then when I chose "View in browser" in VS, I was prompted for my windows login creds. This project never did this before, so I was a bit baffled. I checked all the web.config settings and everything seemed fine. My project settings seemed correct as well. I decided to test the project by opening this same project in VS on a separate dev box on my network using a network path. I again chose "View in browser" and it worked fine. No logon prompt.
This told me that the issue wasn't with the actual web project itself, rather my dev environment. I checked all my browser settings as suggested above, and they were correct. I then compared my project settings while I had the same project (same physical files) opened in both dev boxes. I noticed a difference...
Under the Start Option in the Property Pages, the Web Server was set to use the Default Web server in both cases. However, on the box that was asking for my creds, the NTLM Authentication checkbox was selected. I unselected this and it resolved the issue.
I'm not sure how this was possible since I was opening the same project files, and would assume the project settings would be exactly the same. And the fact it was working fine a week ago really perplexed me. I chalked it up to an issue with VS 2008 on the box with the issue. I hope this helps anyone else that may be running into this issue.
This was because localhost was not in my trusted sites so it wouldn't do automatic NTLM authentication... I'm not sure why it was that way, but it was... adding localhost to the list fixed it.
In your project, there should be a vwd.webinfo file.
The following lines control authentication when debugging (in IISExpress). Set as follows to avoid all dialogs.
<VisualWebDeveloper>
<iisExpressSettings anonymousAuthentication="enabled" windowsAuthentication="disabled" useClassicPipelineMode="false"/>
</VisualWebDeveloper>
If windowsAuthentication="enabled" you may still get a dialog, even if anonymousAuthentication="enabled" :-)

Resources