I have a peculiar problem that just started happening out of the blue.
I will build my application using an IDE, navigate to it in the web browser, and log in.
Log in uses FormsAuthentication to set a cookie.
I then found a bug so I fixed it and rebuild my application.
When i refresh the page I navigated to, it had logged me out of the application and ask to log back in again. (clears my cache or something . . . not sure, HELP!!)
Why is this happening, it never happened before and all of a sudden it started happening.
The application is hosted though IIS 7.
So solved my problem by setting Session Sate Mode Settings and using the State Server option. Just default settings did it for me.
Related
I am working on an ASP.NET webforms application that is being deployed to one of our internal IIS servers.
When I run the website on my machine using IISExpress it runs fine, can access the admin directory, however whenever I deploy to the server I can no longer access the admin directory and it just redirects me to the login page.
I have no code anywhere that should redirect me to the login page, even going so far as to delete the directory and it still redirecting, which would lead me to believe its a browser caching issue. After clearing the browser cache same thing happens, redirects you to the login page.
Another weird thing is that it only does it based on your website login account, when I log in using my actual account it allows me in, but whenever I use a test account with different roles it then redirects me.
I have checked all the usual culprits, HTTP Redirect, Output caching, temp ASP.NET files, master config and the sites own web.config to no avail. I have tried restarting the website and the application pool to no avail, and I can't restart the actual server/iis instance since there are other websites running that cannot be shutoff.
EDIT - Upon renaming the admin folder to admin2 it is now working without issue, so its definitely something to do with IIS. There be ghosts.
I created a web application with asp webforms, ef 6.0 and authentication over owin. on dev system works everything perfect. I published the webapp on iis on windows server 2012. Login works fine, but suddenly after some time, the users are not able to authenticate. I need to make a recycle of the apppool and then its working again. then same again after some time not able to login. I have no excpetions or erros in the windows or app logs. Also the connection to the database is working because i get some user infos from database (tested it with inactive flag). web.config also looks okay. Formsauthentication is deactivated and modules removed.
I have a second webapp also with an owin authentication on same iis without any problems.
someone has a clue what can cause that problem?
thx
Ronald
I think i found the solution.
After the authentication i made
Context.Redirect(url);
I needed to change to
Context.redirect(url, false);
For unclear reasons its possible that the Cookie is not created and added to the context before the redirect. Then asp has No Cookie and redirect again to Login.
Thx, ronald
I have an old ASP.NET intranet application where the forms login page is demonstrating unusual behavior. If any version of IE has a cleared history (history, not cookies) when they submit to log in the page executes a blank post back and remains on the login page.
If they refresh the page or had been redirected to the login page from trying to directly access another page then they are logged in without trouble.
I have published additional copies of this application to the same IIS server and they initially did not exhibit this behavior however after some number of hours they began acting the same way. Republishing to the same instance does not "fix" the issue like publishing to a new site does and neither does removing the old application and then publishing to the same name.
I'm not sure where to go from here so any help would be appreciated.
To me these are the key observations I have made:
This only effects our production server. The same code published to two other servers do not exhibit this defect. This code has worked for years until recently.
I replaced the button click code with a Response.Redirect to Google. When the button is not behaving correctly this redirect was not being fired. This indicates to me that the button code is not being executed. After the page is reloaded/refreshed it redirects properly since the button code is now firing.
When the same code is published to this IIS server under a different name it does not exhibit this defect for a number of hours. What could happen after a few hours to cause this behavioral change? Republishing to the same IIS site does not fix the issue for a few hours like publishing to a new IIS site does.
I have removed the button code from this posting because it is in my opinion a red herring as the code doesn't appear to be being executed at all.
This is what the cookies looked like in the network tools when the site is working
The difference here from when the site is working to when it is not working is that the Form1 key is marked as Sent and not Received.
Something new I have also noticed is that when the site is not working the favicon shows as (aborted). I now believe that the request is being completely aborted because I have overriden the page's OnInit and the code I entered is not being executed when the site is not working.
Today my work opened a ticket with Microsoft to help get this problem resolved and they have said it was a "head scratcher."
I disagree with Nick's thought that there is a problem in the code because of your assertion:
This only effects our production server. The same code published to two other servers do not exhibit this defect. This code has worked for years until recently.
This suggests there is a difference between servers, the way they are configured or the code is deployed that is stopping it from working. As it is a forms authentication problem, I am reminded of the bug that screwed up forms authentication in IE10 - see IE10 User-Agent causes ASP.Net to not send back Set-Cookie (IE10 not setting cookies)
Are your servers identical? Running the same OS, .NET versions, patches, hotfixes etc?
Microsoft saved the day.
They told us that the older versions of IE will look for the favicon in the root folder in IIS and not the application path regardless of where you're pointing it to look. There we found that the root folder's authentication settings were set to Windows Authentication only. For whatever reason this was causing the forms authentication to be aborted until we added Allow Anonymous to the root folder.
I have a MVC application and I can't get it working on IIS 7. Debugging in VS2010 works fine, but when I publish the website to my local IIS7, I see nothing but blank pages.
Here is what I have done:
On the project, right click and click Publish. In the Publish Web window I set these settings:
Publish method: Web deploy
Service URL: localhost
Site/application: Default Web Sit\Africa
both, Mark as IIS application on destination and Leave extra files on destination (do not delete are checked.
In IIS, my application runs under a application pool with supports .net 4.0 and managed pipeline is set to integrated.
I don't get any error while publishing, but when I navigate to my site I only see blank pages. Nothing happens.
What goes wrong?
EDIT:
When I navigate to http://localhost/Africa/ I see a blank page. When I navigate to http://localhost/Africa/Views/Home/ I get a 500 error.
How can I solve this?
I ran in to the same exact problem, it took quite a bit of digging to solve.
I finally found the solution to it on this page: Getting an ASP.MVC2/VS2010 application to work in IIS 7.5
Yeah, I know that this is an old thread but for the sake of saving someone else's time I'm adding this. Also make sure you have HTTP Errors, HTTP Redirection, and Static Content enabled in IIS.
In your application pool advanced settings, make sure you have Enable 32-bit applications set to true.
Some other things to try:
Change the application pool to classic.
Make sure you have the correct version of MVC installed on your server.
If you are getting 500 errors, you can turn on Failed Request Tracing and check the logs. If you are getting 500 errors and no logs are being created, you need to check your web.config.
Blank page normally doesn't necessary mean it's not working, if you default page doesn't have anything, it will be blank.
If you run into some error, you normally will see an error page.
Our client recently complains that when they work on our production server, the user menu switch randomly, but this happens only occasionally .
The application has two types of user menu: regular user and restricted user. The target browser is IE. It's a ASP.NET3.5 application written in C#.
We can never reproduce this issue in our local environment. So it is very difficult to debug it.
Anybody met this type of issue or any clue how to debug it?
Web App Logging
Have you looked into adding a variable to your web.config to have your application perfrom less or more logging. I've done this in the past to track down bugs.
Client-side Logging
Perhaps not the intended use, but http://www.clicktale.com/ provides a javascript site analytics tools that can record all user mouse/keyboard activity that you could correlate to the web app logs. However it cost $$$.
Log Messages. Log them all over that has anything to do with the menu. Then the next time the user reports seeing it look at the log message.
Does the production environment use any load balancing s/w? Perhaps there is a problem with some session scope variables.