---
title: "Where does session stored if cookie is disabled on client’s machine?"  
description: "Where does session stored if cookie is disabled on client’s machine?"  
author: "Anonymous User"  
published: 2015-02-01  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/2321/where-does-session-stored-if-cookie-is-disabled-on-client-s-machine  
category: "c#"  
tags: ["asp.net", "session", "session scope"]  
reading_time: 1 minute  

---

# Where does session stored if cookie is disabled on client’s machine?

If you want to disable the use of cookies in your ASP.NET application and still make use of session state, you can configure your application to store the session identifier in the URL instead of a cookie by setting the cookieless attribute of the sessionState configuration element to true, or to UseUri, in the Web.config file for your application.\
The following code example shows a Web.config file that configures session state to use cookieless session identifiers.\
\
**Code:**\

```
<configuration>
  <system.web>
    <sessionState
      cookieless="true"
      regenerateExpiredSessionId="true"
      timeout="30" />
  </system.web>
</configuration>
```

\

## Answers

### Answer by Anonymous User

If you want to disable the use of cookies in your ASP.NET application and still make use of session state, you can configure your application to store the session identifier in the URL instead of a cookie by setting the cookieless attribute of the sessionState configuration element to true, or to UseUri, in the Web.config file for your application.\
The following code example shows a Web.config file that configures session state to use cookieless session identifiers.\
\
**Code:**\

```
<configuration>
  <system.web>
    <sessionState
      cookieless="true"
      regenerateExpiredSessionId="true"
      timeout="30" />
  </system.web>
</configuration>
```

\


---

Original Source: https://www.mindstick.com/interview/2321/where-does-session-stored-if-cookie-is-disabled-on-client-s-machine

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
