I want to check the value of a session in my ASP.NET website (WebForms). So what I have tried to do is:
// This file called 'Encryptor.cs' and is located under the 'App_Code' folder.
using System;
using System.Data;
using System.Data.OleDb;
using System.Security.Cryptography;
using System.Text;
public static class Encryptor
{
public static bool CheckLoginStatus()
{
bool LoginStatus = false;
if ((string)Session["username"] == null)
{
LoginStatus = true;
}
return LoginStatus;
}
}
I keep getting this message: "The name 'Session' does not exist in the current context." How do I fix it?