Recreating a Session Using a Session ID in ASP.NET

I would like to know if ASP.NET has something similar to a function session_idfrom PHP.

I would like to do something like this using ASP.NET:

session_id($_GET['session_name']);
session_start();
if ($_SESSION['mydata'] != 'somepreviousvaluesetted') {
        header("HTTP/1.0 404 Not Found");
        exit;
} 

Is it possible?

+3
source share
1 answer

A session object has the SessionID property, but it does not give you the ability to start a session; however, global.asax has a Session_Start handler that starts when the session starts. A session begins when the user accesses the application.

NTN.

+1
source

Source: https://habr.com/ru/post/1786734/


All Articles