---
title: "Recreate a Session by Using Your Session ID"  
description: "Recreate a Session by Using Your Session ID"  
author: "Jayden Bell"  
published: 2014-08-26  
updated: 2014-08-26  
canonical: https://www.mindstick.com/forum/2152/recreate-a-session-by-using-your-session-id  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Recreate a Session by Using Your Session ID

I would like to know if [ASP.NET](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) has something similar to session_id [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) from PHP.

## I would like to do something like it using ASP.NET:

```
session_id($_GET['session_name']);session_start();if ($_SESSION['mydata'] != 'somepreviousvaluesetted') {       
header("HTTP/1.0 404 Not Found");        exit;}
```

## Replies

### Reply by Sumit Kesarwani

Hi Jayden,

The session object has a SessionID property, but it does not give you the ability to start a session; however, in global.asax, there is a Session_Start handler which fires when the session does start. The session starts when the user accesses the application.


---

Original Source: https://www.mindstick.com/forum/2152/recreate-a-session-by-using-your-session-id

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
