---
title: "How do you turn off SessionState in the web.config file?"  
description: "How do you turn off SessionState in the web.config file?"  
author: "Sumit Kesarwani"  
published: 2013-06-15  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/1772/how-do-you-turn-off-sessionstate-in-the-web-config-file  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# How do you turn off SessionState in the web.config file?

Section of web.config, you should locate the httpmodule tag and you simply disable session by doing a remove tag with attribute name set to session.

<httpModules>

<remove name=”Session” />

</httpModules>

## Answers

### Answer by Durgesh Tripathi

<configuration>

<system.web>

## <sessionState mode="Off|InProc|StateServer|SQLServer"

cookieless="true|false"

timeout="number of minutes"

stateConnectionString="tcpip=server:port"

sqlConnectionString="sql connection string"

stateNetworkTimeout="number of seconds"/>

</configuration>

</system.web>

Set **the sessionState mode=”Off”** in web.config file to off the session state.

\
**Off** Indicates that session state is not enabled. \
**InProc** Indicates that session state is stored locally. \
**StateServer** Indicates that session state is stored on a remote server. \
**SQLServer** Indicates that session state is stored on the SQL Server.

### Answer by Sumit Kesarwani

Section of web.config, you should locate the httpmodule tag and you simply disable session by doing a remove tag with attribute name set to session.

<httpModules>

<remove name=”Session” />

</httpModules>


---

Original Source: https://www.mindstick.com/interview/1772/how-do-you-turn-off-sessionstate-in-the-web-config-file

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
