Co należy zrobić, jeśli bieżąca sesja ASP.NET ma wartość NULL?

W mojej aplikacji internetowej robię coś takiego, aby odczytać zmienne sesji:

if (HttpContext.Current.Session != null &&  HttpContext.Current.Session["MyVariable"] != null)
{
    string myVariable= (string)HttpContext.Current.Session["MyVariable"];
}

Rozumiem, dlaczego ważne jest sprawdzenie, dlaczego HttpContext.Current.Session ["MyVariable"] ma wartość null (zmienna może nie być jeszcze zapisana w sesji lub sesja została zresetowana z różnych powodów), ale dlaczego muszę sprawdzić JeśliHttpContext.Current.Session jest null?

Rozumiem, że sesja jest tworzona automatycznie przez ASP.NET, dlatego HttpContext.Current.Session nigdy nie powinien być pusty. Czy to założenie jest poprawne? Jeśli może mieć wartość null, czy to znaczy, że powinienem to sprawdzić przed zapisaniem w niej czegoś:

if (HttpContext.Current.Session != null)
{
    HttpContext.Current.Session["MyVariable"]="Test";
}
else
{
    // What should be done in this case (if session is null)?
    // Is it possible to force the session to be created if it doesn't exist?
}

questionAnswers(4)

yourAnswerToTheQuestion