ASP.NET Session disappear/Reappear - asp.net

I've been looking over the net, trying to find some body else who has had this problem before me, but nobody is describing the exact situation I'm in. Others have dropping session states that stay out, or they have short session states as in like 5 minutes, or something of that nature. My issue however, is that my session state variables seem to be there for one postback, skip out on the next one, and be there again for a third sometimes.
You can log into my website: EpicClanWars.com and then maybe refresh a few pages, then after the 2nd or 3rd different page, you get the login text boxes in the upper right like you are not logged in. But then if you refresh the page again, the site will show you as logged in again.
I am assuming this has something to do with the viewstate, but I don't know much about the ASP.NET viewstate or how to troubleshoot it. To support this, I've received a couple of error messages (which I sadly neglected to save for this post) which pertained to MAC problems, and viewstate problems.
I recently had to reinstall the OS on the machine running my site. When I did that, I reinstalled visual studio, IIS, SQL Server, everything. Before the re-install I did not have this problem. I am using VS.NET 2005, and IIS 7.
What is going on here?

You can log into my website:
EpicClanWars.com and then maybe
refresh a few pages, then after the
2nd or 3rd different page, you get the
login text boxes in the upper right
like you are not logged in. But then
if you refresh the page again, the
site will show you as logged in again.
This is a cache issue. From the moment you have dynamic pages and keep the login on every page, then you need to absolute not keep cached page on client. So your client just read a cached page, after the update its get the new one.
On your page you give you have also a dns issue with the www., check it out and make it work. You need to redirect the www.epicclanwars.com to epicclanwars.com, if you won to keep only one copy. At this time the www.epicclanwars.com, just not working at all.
The "In Process", thats keeps them in memory is not so accurate on a shared environment and maybe lose the sessions if your computer runs on his limits or if you have many restarts of your pool for any reason. Maybe if you not solve the problem with the cache on pages, to think also to move the sessions on the database.
Also check on web.config the sessions, httpCookies, forms, roleManager, must have the domain="epicclanwars.com"

Related

Launching SSRS Report causes browser to hang

I have a customer portal with a few reports in it. When I click a report link on the parent page to view a report, a new window opens (window.open) which contains an ASPX page, containing a reportviewer control.
The report runs (less than 30 seconds):
But then something strange occurs.
If I remain on the parent page, 15 minutes later, the browser is unresponsive. I cannot browse to any other pages on the site, I need to close and reopen the browser to continue. If I do NOT choose a report, 15 minutes later the browser is fine.
I've used network tools to see what the network calls looks like, and all I get is that a call was initiated.. nothing indicating a hung HTTP call, etc. It just.. stops.. If i browse the site immediately after running the report, it's fine! But if I hang out on the parent page after running the report (even after closing the child report window) I get the unresponsiveness.
There is a limited set of compatible browsers, especially on older versions of SQL Server SSRS. I would always recommend IE, which it looks like you are not using?
Here's the compatibility info (for SQL 2016, there's a version selector at the top of the page):
https://msdn.microsoft.com/en-us/library/ms156511.aspx#bkmk_reportviewer
Not really the solution, but finally found a more permanent fix for this. I developed a separate website that hosts my ReportViewerControl. I then developed a web form that loads with a meta refresh, after 3 seconds the page will "refresh" and redirect to my secondary ReportViewerControl website.
Something "goofy" was happening here, the session was getting locked up, almost like the more complex the report, the longer the session was locked up, the more of a chance the browser hanging. Something with the meta refresh and the secondary website causes the session to be completely disconnected (I think???)
There's probably no other person in the world that will have this issue, but if it does, at least others know my story =]

ASP.NET 2.0 website white screen of death

I am encountering a strange issue which is only affecting several users from an over 7000 user-base. Having searched the web for several hours to no avail, I'm hoping someone here can help!
I have an ASP.NET 2.0 website and when certain users try to access the home page (Default.aspx) they receive a white screen with no content loaded. This issue is occurring both in production environment and if I run the solution against a copy of production data. So I am able to replicate the exact same issue when I pseudo the problematic users.
When debugging the application in VS2005 and set a breakpoint in the code behind in the Default.aspx, the breakpoints are fired/hit so I know the request is working. The problem seems to be once the server has finished serving the request, the response back to the client/browser is empty.
Here's another strange thing I've noticed. If I alter the HTML in Default.aspx by adding a new white line or whitespace, the page will load fine for the same set of users. I thought I had resolved the issue with this fix but unfortunately the white screen issue just manifests itself once again.
Within Default.aspx, there's some AJAX requests using jQuery .load function but this can't be the issue because this functionality exists for every user of the site. The only variable is the amount of content returned within this request can vary depending on the user. But why would it resolve itself when I put a whitespace or whiteline in the page and then manifest itself hours later?
Another thing to note is it's only Default.aspx that is encountering this issue. If I browse to another page by typing in a page in the address bar, the page is served OK.
Hope someone can point me in the right direction on how I can debug or even resolve the issue.
It sounds like your ajax is the cause but without seeing some code, it's difficult to know why.
It could be a timeout, or an error that is preventing the ajax from completing it's function.
You need to use a tool like Charles or Fiddler to debug what is happening whilst the page loads whilst logged in as these users. In a nutshell, a tool like Charles will display all the detail surrounding requests made and responses served to the browser, including any failed responses.
I think it has to do with http headers, caching or encoding. But I cannot tell more without code.
Is output caching enabled for this page?
Can you give us the raw http headers for both the request and response?
If a white screen appears, will it be fixed by pressing ctrl+f5?

ASP_0147 | 500_Server_Error

This issue has been happening for a while, and it's suspected to be session related since it pertains to the users browser. Opening a new browser (session) rids the issue. The application uses Global.asa (Only Application_OnStart and Sub Session_OnEnd, the rest are empty), Classic ASP (VbScript), IIS 7.0.
This error keeps popping up on url's which happen to be loading fine, until the page is refreshed for the second time, then it bogs out and even times out. In the same browser, if i even try to open that entire website, it times out at this point. For about 350000ms and then everything starts working again. Very weird!
If anyone can help with this, I haven't had any luck anywhere finding what may be causing this, besides something that has to do with the sessions, maybe in the application pool.. I'm not sure.. Any help on this would be appreciated.
Sometimes Google AdSense might cause such problems, disabling it should solve your issues.
To cure the real "root" of the problem and keep using AdSense, guess you'll have to contact Google.

Chrome returns "Bad Request - Request Too Long" when navigating to local IIS Express

I have a web application that runs perfectly fine when I use the Visual Studio 2010 development server (Cassini). However when I try to use IIS Express to host the site Chrome just displays a "Bad Request - Request Too Long" error. The IIS Express site does display in other browsers (FireFox and IE9) so I'm kind of confused. The error occurs in Chrome when I try request pages in my application or even basic resources like an image, so I don't think it is an issue with URL rewriting or routing.
Just to see if the problem was somehow a result of my site's code, I created a new MVC3 website and tried running that. This worked in the VS development server, but once again produced the "Bad Request" error when running under IIS Express.
I am about to start testing the site using some mobile devices so I need to get this running under IIS. Any suggestions would be greatly appreciated.
EDIT:
The root url of the site (http://localhost:50650/) is being requested using GET. I am currently using Chrome v12.0.742.112.
I get this all the time ONLY in Chrome and I have to clear browsing data to fix it.
Wrench > Tools > Clear Browsing Data
Check the following:
Clear browsing history
Clear download history
Empty the cache
Delete cookies and other site data
Then click "Clear Browsing Data" button and refresh your page.
UPDATE:
I figured out that it has to do with writing too many cookies to the browser and that if you just close all instances of Chrome, the error goes away for a while. To prevent it, you'll need to clear out your cookies programmatically.
Instead of clearing all the cookies, just do the following:
Right click the lock in the address bar area (see picture below)
Under cookies there is a link saying how many cookies are used
Click that link
Remove all cookies in there (or just the troublesome if you can identify them)
Problem gone
This error is caused by a corrupt cookie for the website you are trying to view, so to clear it all you need to do is clear the bad cookie(s) for that website.
In Chrome, go to...
chrome://settings/cookies
(Or manually go to Settings->Advanced Settings->Privacy->Content->All Cookies and Site data)
From there, you can search for cookies that match the site you are having problems on. Finally, click "remove all" for the matching cookies.
The problem is usually that the site in question has accumulated too many cookies or created cookies which are too large, making the HTTP headers swell beyond the allowed maximum.
One-time work-around
As has been mentioned, you can go to Settings|Advanced|Content Settings|All Cookies and Site Data, search for the site in question, and delete the cookies using the X button on the right. This reduces the header size of the HTTP request when contacting the site.
Long-term work-around
In addition to removing them one-time, however, you can prevent further problems with heavy cookie sites by going to Settings|Advanced|Content Settings|Manage Exceptions, and add the base site url (e.g. "msdn.microsoft.*" without the quotes) and select Behavior as "Clear on Exit". You might have to login more often to these sites, but this should prevent the problem.
I encountered this problem when using ADB2C login from ASP.NET WebApp. In Firefox you can do similar use case to delete related coockies and problem is gone for a while. Click on HTTPS (i) lock icon with, select ">" button on the right, select More information, select Security tab, click on View Cookies and click on Remove All. Done 4 a while.
If Above methods didn't work then enter
chrome://settings/resetProfileSettings
and Click on Reset Settings
This will reset your startup page, new tab page, search engine, and pinned tabs. It will also disable all extensions and clear temporary data like cookies. Your bookmarks, history and saved passwords will not be cleared.

slow of first page, running on windows/IIS

I'm more into the LAMP stack, but I've been asked to work on a site that is running Windows and IIS 2008. I'm a beginner with IIS, so please be patient with me on this, and please ask me to provide more information if that is needed to determine.
I read the answer here (Slow first page load on asp.net site), but it seems like if I go to the site with one browser it takes long to load the first page, then fast on all other pages, then if I open up another browser, it's the same thing, so it's not something that is saved on the server, but per session?
Is there a way to have the application running at all times?
Right now it is taking 12 to 15 seconds for the first page to load.
I have access to the WebControlCenter and FTP.
I would look in the Global.asax page and see if there is anything going on when a session is started. There usually is a method in there called Session_Start that is called whenever a session is started. Also, it might have to do with the site being configured in debug mode. You can change the web.config setting to false, which has a big impact on performance.
I'm familiar with the phenomenon described in the question you've linked to, but your what you're describing does seem a bit odd.
firstly- try Jeff's suggestion and see if indeed there's something at the beginning of the session which slows it down.
If not- try answering this-
1. is the first page always slow or only on first access to it?
2. what happens if you open another tab in the browser (not a different browser)?
3. it's possibel that the page contains some heavy resources (like images, script files etc.) which are only downloaded on the first access to the page. try tracing your http responses you get and see what their sizes are.
4. try to enable trace on your web page to see the events which are taking the longest time (on aspx you need to add 'Page Trace="true"' to the page declaration)
hope one of these helps...
Have you tried a http debugger here? Lots of things could be going on here, but the fact that you get different behavior by using different browsers indicates it is probably some particular resource that is overweight.

Resources