Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i am very new to MVC and currently i got a requirement that i have to remove session from all the pages, so i should not store anything in session and have to replace with other concept to achieve this because don't want stop application.

currently in session i am just keeping login details and Module allowed and retrieving from other pages.you can see the below code to understand clearly

C#
LoginCredential SessLogin = new LoginCredential();
SessLogin.ModuleAllowed = new List<secmodule>();
SessLogin.RLPEmpId ="V0008293"
SessLogin.RLPEmpName = "Santosh"
SessLogin.RLPEmpLocation = "India"

Var tempTop = somedatatable;
SessLogin.ModuleAllowed = tempTop;
Session["SessLogin"] = SessLogin;= SessLogin

---below two class used to assign value below storing in session.
public class LoginCredential
{
public string RLPEmpId { get; set; }
public string RLPEmpName { get; set; }
public string RLPEmpLocation { get; set; }
public List <secmodule>; ModuleAllowed { get; set; }
}

public class SECModule
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int ID { get; set; }
public int ParentID { get; set; }
public string ModuleName { get; set; }
}

Any doubt let me know

Thanks
Santosh
Posted
Updated 26-May-15 18:05pm
v3
Comments
F-ES Sitecore 27-May-15 4:31am    
Replace it with what? Rather than replacing the session you're better explaining *why* you don't want to use the session as there is probably an alternative solution to the underlying problem like state server, SQL session storage etc.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900