Servicios Profesionales (consultoras que apoyan el proyecto Mundo Support GX)

Para informarse sobre las soluciones y servicios en:
 - Genexus Software Factory.
 - Búsqueda, Selección & Outsourcing de RRHH.
 - Gerenciamiento externo de Proyectos.
 - Asistencia técnica.
 - Software ERP.

Click Aquí o escriba a mundosupport@gmail.com.

         
             

Bienvenido a Mundo Support

Te damos la bienvenida a Mundo Support GX!!!!!

Como usuario visitante podrás consultar libremente los artículos y comentarios publicados; además de escribir comentarios que aporten y enriquezcan a los artículos.

Si deseas redactar artículos, entradas o consultas te invitamos a que nos escribas a mundosupport@gmail.com y recibirás un correo invitándote a ser redactor contribuyente.

Gracias y esperamos contribuir en tu camino por el mundo Genexus y la programación.



lunes, 5 de mayo de 2008

Web.Error - Timeout en Websession con .NET

Luego de pasar un determinado tiempo las variables websession pierden su valor. Esto se debe a que caducan, por defecto tienen un timeout de 20 minutos, pero este valor puede ser configurable.

Para modificarlo editar el web.config y setear en la seccion de configuration/system.web:
<sessionState mode="InProc"
cookieless="false"
timeout="20"/>
el default es 20 minutos.

Mas informacion en http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/deployguide/iisdg_net_mshe.asp

En w2003Server es posible configurar el timeout por directorio virtual. para ello en las propiedades del directorio virtual, configurar tab virtualdirectory\Configuration\options\Enabled Session State

Nota: en la documentacion la seccion session state se cierra con </sessionState>, pero lo corecto es sin cerrarlo, algo como
<sessionState mode="InProc" stateConnectionString="tcpip=27.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20" />


Configuring ASP.NET Applications to Use the Appropriate Session

StateYou can configure ASP.NET session state persistence in the <sessionState> section of the Machine.config file for all of the ASP.NET applications on the Web server, or you can configure it in the Web.config file for each ASP.NET application. If the <sessionState> section of the Web.config file for an ASP.NET application is empty, the session state configuration for the application is inherited from the <sessionState> section of the Machine.config file.

If the <sessionState> section does not exist in the Machine.config file or the Web.config file, the following is the default session state behavior:

The session time-out value for an ASP.NET session state is 20 minutes.
The session state is maintained within all of the applications running in the same application pool.
The session state is only maintained on the local Web server (where the session state mode attribute is set to InProc), not across multiple servers in a Web farm.
In addition to the configuration settings that are specific to the mode you selected for maintaining session state, the following attributes need to be configured:

The cookieless attribute. This attribute determines whether or not the session identifier is transferred between the Web server and the client by using cookies. When the cookieless attribute is set to True, cookies are not used to convey session identifiers. When the cookieless attribute is set to False, cookies are used to convey session identifiers. The default setting is False.
The timeout attribute. This attribute specifies the number of minutes that a session is considered valid. When the time specified in the timeout attribute expires, the session is disconnected. The default time-out limit is 20 minutes.
Configure the session state settings in the <sessionState> section for the mode that you selected.

Session state is maintained in-process
To maintain session state in-process, you can either delete the <sessionState> section or configure the <sessionState> section in the Machine.config file or the Web.config file.

The following is an example of the configuration when maintaining session state in-process:

<configuration>
<system.web>
<sessionState
mode="InProc"
cookieless="true"
timeout="20"
</sessionState>
</system.web>
</configuration>
Session state is maintained out-of-process with the ASP.NET state service
To configure ASP.NET to maintain session state with the ASP.NET state service, modify the following attributes in addition to the mode attribute:

The stateConnectionString attribute. This attribute specifies the IP address and port number where the ASP.NET state service is running. The format for this attribute is "tcpip=server:port", where server is the IP address or host name of the server, and port is the TCP port number that the ASP.NET state service is configured to use. The default port number is 42424.
The stateNetworkTimeout attribute. This optional attribute specifies the length of time, in seconds, that the TCP/IP network connection between the Web server and the server running the ASP.NET state service can be idle before the session is abandoned. The default time-out limit is 10 seconds.
The following is an example of the configuration when maintaining session state out-of-process with the ASP.NET state service:

<configuration>
<system.web>
<sessionState
mode="StateServer"
cookieless="true"
timeout="20"
stateConnectionString="tcpip=127.0.0.1:42424"
stateNetworkTimeout=”10”
</sessionState>
</system.web>
</configuration>
Session state is maintained out-of-process with a computer running Microsoft SQL Server
To configure ASP.NET to maintain session state with a computer running SQL Server, modify the sqlConnectionString attribute in addition to the mode attribute. The sqlConnectionString attribute specifies the ODBC data connection string used for establishing the connection to the computer running SQL Server.

The format for the sqlConnectionString attribute is "data source=odbc_connection_string", where odbc_connection_string is any valid ODBC data connection string that is valid for the computer running SQL Server. For more information about creating ODBC data connection strings for Microsoft SQL Server, see the MSDN Online link on the Web Resources page at http://www.microsoft.com/windows/reskits/webresources, and then search for "How to allocate handles and connect to SQL Server (ODBC)".

The following is an example of the configuration when maintaining session state out-of-process with a computer running SQL Server:

<configuration>
<system.web>
<sessionState
mode="SQLServer"
cookieless="true"
timeout="20"
sqlConnectionString="data source=localhost;
Integrated Security=SSPI;
Initial Catalog=northwind"
</sessionState>
</system.web>
</configuration>


 

No hay comentarios:

Que opinás del material expuesto en el Blog?