You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/azure/azure-storage/files/performance/files-troubleshoot-performance.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -279,7 +279,7 @@ For example, you can set it to `0x100000` and see if performance improves.
279
279
280
280
## [Linux](#tab/linux)
281
281
282
-
The amount of memory available influences the number of inode hash buckets the system has, which impacts/improves enumeration performance for large directories. You can modify the number of hash buckets the system has to reduce the hash collisions that can occur during large enumeration workloads. For instructions, see [Increase the number of hash buckets](/azure/storage/files/nfs-large-directories#increase-the-number-of-hash-buckets).
282
+
The amount of memory available influences the number of inode hash buckets the system has, which affects and improves enumeration performance for large directories. You can modify the number of inode hash buckets the system has to reduce the hash collisions that can occur during large enumeration workloads. For instructions, see [Increase the number of hash buckets](/azure/storage/files/nfs-large-directories#increase-the-number-of-hash-buckets).
ms.custom: sap:WWW Authentication and Authorization\Forms authentication
8
8
---
@@ -13,36 +13,25 @@ _Applies to:_ Internet Information Services
13
13
14
14
Often, while using Forms Authentication in an ASP.NET web application, there's a need to troubleshoot a problem that occurs when a new or an ongoing request is intermittently redirected to the application's login page. You can debug this problem on Visual Studio IDE by attaching a debugger in a development environment. In production environments, however, the task becomes hectic and problematic. To troubleshoot a random problem like this one, you need to log information related to the problem so that you can narrow down the root cause.
15
15
16
-
This article briefly discusses the concept of Forms Authentication. It also discusses about various scenarios about a user being redirected to the login page and how to capture data that's relevant to isolating the problem. Additionally, it also discusses about how to implement an `IHttpModule` interface to log the Forms Authentication information.
16
+
This article briefly discusses the concept of Forms Authentication. It also discusses various scenarios about a user being redirected to the login page and how to capture data that's relevant to isolating the problem. Additionally, it also discusses how to implement an `IHttpModule` interface to log the Forms Authentication information.
17
17
18
18
## Overview of ASP.NET Forms Authentication
19
19
20
20
Forms authentication lets you authenticate users by using your own code and then maintain an authentication token in a cookie or in the URL. Forms authentication participates in the ASP.NET page life cycle through the `FormsAuthenticationModule` class. You can access forms authentication information and capabilities using the `FormsAuthentication` class.
21
21
22
-
To use forms authentication, create a login page that collects credentials from the user and includes code to authenticate the credentials. Typically, you configure the application to redirect requests to the login page when users try to access a protected resource, such as a page that requires authentication. If the user's credentials are valid, you can call methods of the `FormsAuthentication` class to redirect the request back to the originally requested resource with an appropriate authentication ticket (cookie). If you don't want the redirection, you can just get the forms authentication cookie or set it. On subsequent requests, your browser passes the authentication cookie with the request, which then bypasses the login page.
22
+
To use forms authentication, create a login page that collects credentials from the user and includes code to authenticate the credentials. Typically, you configure the application to redirect requests to the login page when users try to access a protected resource, such as a page that requires authentication. If the user's credentials are valid, you can call methods of the `FormsAuthentication` class to redirect the request back to the originally requested resource with an appropriate authentication ticket (cookie). If you don't want the redirection, you can just get the forms authentication cookie or set it. On subsequent requests, your browser passes the authentication cookie with the request, which then bypasses the login page.
23
23
24
-
By default, the `FormsAuthenticationModule` class is added in the *Machine.config* file. The `FormsAuthenticationModule` class manages the Forms Authentication process.
24
+
By default, the `FormsAuthenticationModule` class is added in the **Machine.config** file. The `FormsAuthenticationModule` class manages the Forms Authentication process.
25
25
26
-
The following is an entry from the *Machine.config* file:
26
+
You can see the following entry in the **Machine.config** file:
You can configure forms authentication by using the authentication configuration element. For instance, you have a login page. In the configuration file, you specify a URL to redirect unauthenticated requests to the login page. Then define valid credentials, either in the *Web.config* file or in a separate file. The following example shows a section from a configuration file that specifies a login page and authentication credentials for the `Authenticate` method. The passwords have been encrypted by using the `HashPasswordForStoringInConfigFile` method.
You can configure forms authentication by using the authentication configuration element, for example, setting a login page. In the configuration file, specify a URL to redirect unauthenticated requests to the login page.
46
35
47
36
After successful authentication, the `FormsAuthenticationModule` module sets the value of the User property to a reference to the authenticated user. The following code example shows how to programmatically read the identity of the forms-authenticated user.
48
37
@@ -64,34 +53,34 @@ You log on to the website. At some point, the client sends a request to the serv
64
53
65
54
### Scenario 2
66
55
67
-
The forms authentication cookie can also be lost when the client's cookie limit is exceeded. In Microsoft Internet Explorer, there is a limit of 20 cookies. Once the counter reaches 20, the previous 19 cookies are removed from the client's collection. If the ASPXAUTH cookie is removed, you are redirected to the login page when the next request is processed.
56
+
The forms authentication cookie can also be lost when the client's cookie limit is exceeded. In Microsoft Internet Explorer, there's a limit of 20 cookies. Once the counter reaches 20, the previous 19 cookies are removed from the client's collection. If the ASPXAUTH cookie is removed, you're redirected to the login page when the next request is processed.
68
57
69
58
### Scenario 3
70
59
71
60
After the request leaves the client, there are various layers that can affect the packets that are being sent. To determine if a network device is removing the cookie, you have to capture a network trace on the client and the server, and then look in the body of the request for the cookie. You want to look at the client request to make sure that the cookie was sent, and check the server trace to make sure that the server received the cookie.
72
61
73
62
**Forms authentication ticket timed out**
74
63
75
-
In ASP.NET 2.0 applications onwards, by default, the forms authentication timeout value has changed to be 30 minutes. This means that after 30 minutes of inactivity, you will be prompted to log in again.
64
+
In ASP.NET 2.0 applications onwards, by default, the forms authentication `timeout` value has changed to be 30 minutes. This means that after 30 minutes of inactivity, you'll be prompted to log in again.
76
65
77
66
> [!NOTE]
78
-
> When you access a website each time, the 30-minute window clock is reset. Only if it's idle there's a timeout.
67
+
> When you access a website each time, the 30-minute window clock is reset. Only if it's idle there's a time-out.
79
68
80
-
If you want to change the timeout value to be longer, you can easily change the timeout value in your local *web.config* file (the timeout value is in minutes):
69
+
If you want to change the `timeout` value to be longer, you can easily change the `timeout` value in your local *web.config* file (the `timeout` value is in minutes):
81
70
82
71
```xml
83
72
<system.web>
84
73
<authenticationmode="Forms">
85
-
<formstimeout="50000000"/>
74
+
<formstimeout="120"/>
86
75
</authentication>
87
76
</system.web>
88
77
```
89
78
90
79
### Scenario 4
91
80
92
-
Form authentication can expire prior to the value of the timeout attribute defined in the configuration file.
81
+
Form authentication can expire prior to the value of the `timeout` attribute defined in the configuration file.
93
82
94
-
If the forms authentication ticket is manually generated, the timeout property of the ticket will override the value that's set in the configuration file. Therefore, if that value is less than the value in the configuration file, the forms authentication ticket will expire before the configuration file timeout attribute value and vice-versa. For example, let's assume that the `FORMS` timeout attribute is set to 30 in the *Web.config* file and the expiration value of the ticket is set to 20 minutes. In this case, the forms authentication ticket will expire after 20 minutes and then you have to log on again.
83
+
If the forms authentication ticket is manually generated, the `timeout` property of the ticket overrides the value that's set in the configuration file. Therefore, if that value is less than the value in the configuration file, the forms authentication ticket expires before the configuration file `timeout` attribute value and vice-versa. For example, let's assume that the `FORMS` timeout attribute is set to 30 in the *Web.config* file and the expiration value of the ticket is set to 20 minutes. In this case, the forms authentication ticket expires after 20 minutes and then you have to log on again.
95
84
96
85
```output
97
86
Event code: 4005
@@ -120,31 +109,31 @@ You can determine if a request doesn't contain the cookie by enabling cookie log
120
109
1. Make sure that the log format is W3C Extended Log file format.
121
110
1. Select **Properties**.
122
111
1. Select the **Advanced** tab, and then select **Extended Properties**.
123
-
1. Under **Extended Properties**, select the **Cookie(cs(Cookie))** and the **Referer (cs(Referer))** checkboxes.
112
+
1. Under **Extended Properties**, select the **Cookie(cs(Cookie))** and **Referer (cs(Referer))** checkboxes.
124
113
125
114
After this problem occurs, determine which client had the problem and that client's IP address. Filter the IIS log on that client's IP address, and view the `<COOKIE>` column.
126
115
127
116
> [!NOTE]
128
-
> Use Log Parser to parse the IIS Logs. Download [Log Parser](https://www.microsoft.com/en-in/download/details.aspx?id=24659).
117
+
> Use [Log Parser](https://www.microsoft.com/download/details.aspx?id=24659) to parse the IIS Logs.
129
118
130
119
After you have the list of requests from a specific user, search for the requests to the login page. You would know they were redirected to this page, and you would want to see the requests before the redirection occurred. If you see something similar to the following, the client either didn't send the cookie or the cookie was removed on the network between the client and server.
131
120
132
121
> [!NOTE]
133
-
> The first request isn't likely to have a forms authentication cookie unless you are creating a persistent cookie. The IIS Log will only show the cookies that were received in the request. The first request to have the forms authentication cookie after a successful login attempt.
122
+
> The first request isn't likely to have a forms authentication cookie unless you're creating a persistent cookie. The IIS Log will only show the cookies that were received in the request. The first request to have the forms authentication cookie after a successful login attempt.
134
123
135
124
### Troubleshooting scenario 2
136
125
137
126
Microsoft Internet Explorer complies with the following RFC 2109 recommended minimum limitations:
138
127
139
128
- At least 300 cookies.
140
-
- At least 4096 bytes per cookie (as measured by the size of the characters that comprise the cookie non-terminal in the syntax description of the Set-Cookie header).
129
+
- At least 4,096 bytes per cookie (as measured by the size of the characters that comprise the cookie non-terminal in the syntax description of the Set-Cookie header).
141
130
- At least 20 cookies per unique host or domain name.
142
131
143
-
The forms authentication cookie can also be lost when the client's cookie limit is exceeded. In Microsoft Internet Explorer, there is a limit of 20 cookies. Once the counter reaches 20, the previous 19 cookies are removed from the client's collection. If the ASPXAUTH cookie is removed, you are redirected to the login page when the next request is processed. You can use Fiddler to see the HTTP request or response headers to see if you are receiving the cookie from the client. Download [Fiddler](http://fiddler2.com/fiddler2/).
132
+
The forms authentication cookie can also be lost when the client's cookie limit is exceeded. In Microsoft Internet Explorer, there's a limit of 20 cookies. Once the counter reaches 20, the previous 19 cookies are removed from the client's collection. If the ASPXAUTH cookie is removed, you're redirected to the login page when the next request is processed. You can use Fiddler to see the HTTP request or response headers to see if you're receiving the cookie from the client. Download [Fiddler](http://fiddler2.com/fiddler2/).
144
133
145
-
Launch Fiddler tool on the client machine, remove existing HTTP traces, access your application implementing forms authentication and try to login into the application and observe the HTTP traffic on Fiddler to see if there's an exchange of forms authentication cookie happening between the client and server. After you capture the traffic, double-click a request, and then select **Headers** to see the Set-Cookie header. If you trace a successful login, you will see the Set-Cookie header in the response of a successful login.
134
+
Launch Fiddler tool on the client machine, remove existing HTTP traces, access your application implementing forms authentication and try to login into the application and observe the HTTP traffic on Fiddler to see if there's an exchange of forms authentication cookie happening between the client and server. After you capture the traffic, double-click a request, and then select **Headers** to see the Set-Cookie header. If you trace a successful login, you'll see the Set-Cookie header in the response of a successful login.
146
135
147
-
By default, IE can store a maximum of 20 cookies for each domain. If a server in the domain sends more than 20 cookies to a client computer, the browser on the client computer automatically discards some old cookies.
136
+
By default, Internet Explorer can store a maximum of 20 cookies for each domain. If a server in the domain sends more than 20 cookies to a client computer, the browser on the client computer automatically discards some old cookies.
148
137
149
138
Each cookie consists of a single name-value pair. This pair may be followed by attribute-value pairs that are separated by semicolons. This limit has been increased to simplify the development and the hosting of Web applications on domains that must use many cookies. Installing update 937143 increases the number of cookies that Internet Explorer can store for each domain from 20 to 50. For more information, see [Internet Explorer and Microsoft Edge frequently asked questions (FAQ) for IT Pros](/internet-explorer/kb-support/ie-edge-faqs).
150
139
@@ -187,14 +176,18 @@ When you see the request that reached the server, make sure that the server rece
187
176
188
177
### Troubleshooting scenario 5
189
178
190
-
- If the scenario involves a web farm, then the machineKeys should be same across everywhere. Use the following machineKey to maintain the consistency on all the servers on the farm:
179
+
- If the scenario involves a web farm, make sure that the configuration files on each server in the web farm have the same value for the validation key and decryption keys, which are used for hashing and decryption, respectively. To maintain the consistency on all the servers in the farm, use the following machineKey:
For more information on machine keys, see [Machine Key](/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh831711(v=ws.11)) and [Plan Application Security](/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/planning-step-4-plan-application-security#44-machine-key-settings).
To learn how to generate machine keys, see [Machine Key Settings](/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-4-configure-application-security#44-machine-key-settings).
195
188
196
-
- Compare the timeout values for both forms that isauthentication module and the session module on all of the web servers.
197
-
- Compare the *System.Web.dll* version under Framework folder for ASP.NET 4 between all of the web servers in the farm. Forms authentication failed for the request. The reason is that the ticket supplied was invalid. This happens due to missing Reliability Update 1 for MS .NET framework 4 on one of the web server.
189
+
- Compare the `timeout` values for both forms, that is, the authentication module and the session module, on all of the web servers.
190
+
- Compare the **System.Web.dll** version under the Framework folder for ASP.NET 4 between all of the web servers in the farm. Forms authentication failed for the request. The reason is that the ticket supplied was invalid. This happens due to missing Reliability Update 1 for MS .NET Framework 4 on one of the web servers.
198
191
- Install the Reliability Update 1 for the .NET Framework 4 kb2533523 on the server that was missing it and rebooted the server. The issue is fixed. For more information, see [Reliability Update 1 for the .NET Framework 4](https://support.microsoft.com/topic/reliability-update-1-for-the-net-framework-4-5a8de0be-f4a9-f89e-e40d-f59dd1e353e5).
0 commit comments