Extend IIS session default time - visual-studio

I have a website that will be used by inspectors, they have to travel to various places and do their job, the default time by iis to hold sessions alive is too short. Where do I set a longer session time? I need for example 1 hour.
I check on IIS the ASP setting for the website and changed the default 20 mins to 60 mins but it is ignoring it.

The best way is to define the session timeout in the sessionState element of the web.config file of your application.
<configuration>
<system.web>
<sessionState mode="InProc" timeout="60" />
</system.web>
</configuration>
You should check the following link for more detailed information:
http://msdn.microsoft.com/en-us/library/h6bb9cz9(v=vs.85).aspx

Related

Why IIS localhost very slow loading

Using GeneXusX ev3 U15m, C# (net), Web, Sqlserver.
When change some object and build this, refresh website and wait for long time (more 9 minutes).
Test with move parameters IIS, hosts, web.config, debug off (only release), without firewall, and same.
¿Have you tried with the tag optimizeCompilations="true" in the web.config?
Original line :
<compilation debug="true" strict="false">
Change it to:
<compilation debug="true" strict="false" optimizeCompilations="true">
This avoids recompiling the whole site when refreshing when any change is made.

OOF not working - Server Error in '/EWS' Application

We are trying to configure OOF on an Exchange Server. We are talking about Outlook 2010 with Exchange server 2010.
If i navigate to https://mail.[server]/ews/exchange.asmx i see the following page:
Server Error in '/EWS' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
I already recreated EWS, OWA and OAB, without any effect.
There is no proxy active in the organisation.
There are no internet restrictions.
Help

IIS8.5 Windows authentication

I am trying to create a web application in my company and I want to get the username requesting the page to define what he/she can do. My environment is a Windows 2012 R2/IIS8.5. The server is in the corporative domain. What I have tried was to enable Windows Authentication and Disabling the anonymous authentication.
Here is the Web.config file with the set recommended.
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Windows" />
<authorization>
<deny users="?"/>
</authorization>
...
</system.web>
Here is the Authentication configuration sets
My problem is that when I do any of the things above I get the Error 404.
If I let the Anonymous Login enabled and the Windows Authentication disabled and remove the Web.config settings the application works.
I need some help to guide on this. I tried to find a tutorial explaining how to do that but I could not find something that explain it clearly. I am starting using IIS.
EDIT1
I have enable the detail error pages and what I am getting is the error 404.15 (URL too long). It seams that it happening when I disable Anonymous Authentication in my application. Does anyone have faced this problem?
Thanks
I managed to solve it.
Originally I was creating the web application with .NET framework 4.5. When I changed it to 4.0 the windows authentication worked fine and I was able to get the logged user using User.Identity.Name.

MVC 3 Application making users login every 2 minutes

I have a mvc 3 application that uses standard authorization and stock logon. After a user logs in it will take less than 2 minutes and they have to log back in.. Is there any fix for this??
The last time I had this problem was on an instance of nopCommerce running on a shared host. Frequent app pool recycles were causing my cookies to be treated as invalid and forcing my users to log in again.
The solution that worked for me was to manually set a <machineKey> in my web.config file. The default setting allows the framework to generate a key pair for you every time the app starts up, which explains why the forms auth cookies couldn't be decrypted anymore at the server and were treated as invalid.
You can generate a valid key pair at http://aspnetresources.com/tools/machineKey
In your root web.config, have you double checked the timeout property is set correctly?
<system.web>
...
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
...
<system.web>
Have you checked it is actually logging the person on (eg soon as you log in, can you browse to a second/third page and it still has them logged in)

Should I leave <customErrors mode="Off"/> in release web.config?

also this line was added automatically by Visual Studio:
Should I turn it to debug="false" in the release web.config?
Many thanks.
You should set customErrors to On or RemoteOnly. The latter would mean that anyone using the local machine will see the full error page, but any outside users won't. The less information outside users have about how your web application works, the better. You could do something like this:
<customErrors mode="On" defaultRedirect="~/ErrorPage.aspx"/>
You can also give a bit more specific information about the error users.
<customErrors mode="On" defaultRedirect="~/ErrorPage.aspx">
<error statusCode="404" redirect="~/404error.aspx" />
</customErrors>
For production, you should set Debug to false.
Reasons on why Debug should be set to false can be read about here.
1) The compilation of ASP.NET pages
takes longer (since some batch
optimizations are disabled)
2) Code can execute slower (since some
additional debug paths are enabled)
3) Much more memory is used within the
application at runtime
4) Scripts and images downloaded from
the WebResources.axd handler are not
cached

Resources