Change session timeout on IIS Express? - iis

I would like to test session timeout problems while using IIS Express but I can't figure out how to modify the Session State setting so I can change the Time-out for Cookie Settings. Is this a modifiable setting?

Try following
1.In the web application's web.config file set sessionState timeout something like below (it is in minutes)
<sessionState timeout="30" />
2.Make sure that your application's app pool idle time out is greater than or equal to the timeout specified above (you can run the following command from the iisexpress installation folder)
appcmd set config /section:applicationPools /[name='YourAppPoolName'].processModel.idleTimeout:0.00:30:00

Related

What steps are required to make ColdFusion websockets work on an Azure VM behind Cloudflare?

We are attempting to use websockets in ColdFusion (2018.0.13.329786) in an app we have running on Azure VMs behind Cloudflare. However, we are continually getting this error on the client side:
WebSocket connection to 'wss://www.*************.com/cfws' failed:
CFWebSocketWrapper.open # cfwebsocketCore.js:21
init # cfwebsocketChannel.js:49
_cf_websockets_init_6539553945348401 # strategies-for-devel…ing-with-impact:175
fire # cfajax.js:1214
$E.windowLoadHandler # cfajax.js:1321
Uncaught TypeError: Cannot set properties of undefined (setting 'readyState')
at WebSocket.wsConnection.onerror (cfwebsocketCore.js:54:29)
wsConnection.onerror # cfwebsocketCore.js:54
error (async)
CFWebSocketWrapper.open # cfwebsocketCore.js:53
init # cfwebsocketChannel.js:49
_cf_websockets_init_6539553945348401 # *************:175
fire # cfajax.js:1214
$E.windowLoadHandler # cfajax.js:1321
load (async)
$E.onWindowLoad # cfajax.js:1297
cfinit # cfajax.js:1332
(anonymous) # cfajax.js:1834
We have a cfc that's called when a message is posted to a channel that writes to a log file on the server, and this log file never gets updated. This is unsurprising as it appears that something is preventing the connection altogether.
From a configuration perspective, we run these updates when the VM is created:
webSocketObj= createObject("component","cfide.adminapi.websocket");
webSocketObj.setProperty(propertyName="EnableWebSocketServer", propertyValue="true");
webSocketObj.setProperty(propertyName="EnableProxyPort", propertyValue="8581");
and then via cfExecute:
#server.coldfusion.rootdir#/lib/wsproxyconfig.jar -ws IIS -site All -host localhost -port 8581
and then the CF service and IIS are restarted.
We have also enabled the websocket 'switch' in Cloudflare.
This should be the same as going into CF Admin, going to the websockets tab, and then ticking "Use Proxy", and then using the default port of 8581. This should send everything through IIS on port 443 from the client perspective.
Cloudflare and Azure say that no special configuration is needed. And we can see that CF has port 8581 open.
The most infuriating thing is that we worked on this in our Dev environment last year and after much trial and error got it working. However, our notes from that time were not good and when we did the above to try to get this working in our QA environment it did not work. We're obviously missing a step somewhere, but have not been able to figure it out.
Can anyone who has gotten this working explain what steps are required to make ColdFusion websockets work on an Azure VM behind Cloudflare?
We solved this issue. Hopefully this will help anyone else who runs into the same problem:
Per this doc, we realized that the wsproxyconfig was supposed to be creating an 'application' (like a virtual folder) in IIS called cfws pointing to <CF_INSTALL_HOME>/config/wsproxy/1. However, it was not doing so. Once that application was created, everything started working as expected.
Upon further testing we found that it created this application only if it was run as administrator. Otherwise, it reported success and provided no warnings or failures, but did not create the application.
We were running wsproxyconfig from the command line via CFExecute, so it was running under an administrative user, but that was apparently not sufficient. So we moved the wsproxyconfig call to one of our PowerShell scripts and had it run with administrative privileges and that solved our problem.
This had apparently worked in our dev environment originally because we ran wsproxyconfig manually.

what should be the value of connection timeout in iis server for a ticketing application

I am working on an Application which is a ticketing tool,user log ticket corresponding to each task assign to them,there is Slow http post vulnerability in that which can be remove by manipulating connection timeout on iis server.
what should be the idea value of connection timeout for which i can solve that vulnerability?
please do help.
The security vulnerability can be fixed by updating the Limits settings for the web site.
1)Open IIS Manager
2)Select your site
3)On the Actions panel, click "Limits"
4)Set Connection time-out to 30
5)Check "Limit number of connections" and set the value to 1024.
6)Click OK
restart iis.

IIS Download Timeout after 2 Minutes

I have a website with an application in IIS 8.5. Now when we start a download then the connection timed out after 2 minutes.
I set the connection timeout in "Set Website Defaults" and on the application level in the web.config to 10 minutes but downloads still stop after 2 minutes.
I would be happy if someone could guide me on this.
According to your description, I suggest you could improve the connection timeout value to solve this issue.
You could open your IIS management console , click the application and find the advanced setting.
Then you could modify the connection timeout value(default is 120 seconds).
You need to add <httpRuntime executionTimeout="600" /> in the web.config of your application - in the system.web section.

ASP.NET Core 2.1 Give me HTTP Error 502.5 - Process Failure

After using deploying my .NET Core 2.1 App to my server, I get the following error when I access the page:
HTTP Error 502.5 - Process Failure
Following Microsoft's always helpful link on the same page (cough cough), I checked the Event View Log and it states:
Application 'MACHINE/WEBROOT/APPHOST/BLAH.COM' with physical root
'D:\inetpub\vhosts\BLAH.com\httpdocs\' failed to start process with
commandline 'dotnet .\blah.dll', ErrorCode = '0x80070002 : 0.
The message was not only unhelpful, but completely irrelevant. I tried to enable the web app's logging in web.config:
<aspNetCore requestTimeout="23:00:00" processPath="dotnet" arguments=".\blah.dll" forwardWindowsAuthToken="false" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" startupTimeLimit="3600" />
Oddly, no files were created in the Log directory until I granted permission to my IWPD process. The files it created weren't in the stdout directory as specified, but were in the parent log directory. They also were empty.
I ran the web app from the command line using:
dotnet .\blah.dll
The application appeared to run and I could see some messages on the screen, but I still got the same 502.2 error accessing the site with no additional information in the logs. I followed the troubleshooting steps for ASP.NET Core 2.1 and it mentioned this:
If the errors occur when making a request to the app, make a request
to the host and port where Kestrel listens. Using the default host and
post, make a request to http://localhost:5000/. If the app responds
normally at the Kestrel endpoint address, the problem is more likely
related to the reverse proxy configuration and less likely within the
app.
I ran the web app from the command line and tried to access it using http://localhost:5000. I was finally able to access the site, but I still got the same 502.2 error via IIS.
It's obvious IIS and Kestrel are not communicating with each other. I don't understand why there's two web servers and how to get them to communicate with each other.
Solved the problem. The installer for the server's IIS module doesn't restart or warn the user to restart IIS. Restarting IIS loaded the necessary module. Clearly, this is a bug by any other name.

IIS Aplication Pool not When The Server is Turn On?

Hi i have a problem with one server, and the problem is that the server iis does not start automatically one of the app pools that we have for one of our applications, but if you go to the iis and make right click on the app pool and click start the app pools starts fine.
Any Idea
Jean
See if the App Pool is set to autostart:
adsutil.vbs get w3svc/AppPools/DefaultAppPool/AppPoolAutostart
Chnage DefaultAppPool to your app pool name.
To set it to auto start, use
adsutil.vbs set w3svc/AppPools/DefaultAppPool/AppPoolAutostart true
Does you application in the AppPool depend on other services (eg SQL) that might still be starting?
I recall Skype used to hijack my port 80 as IIS took too long to start.

Resources