Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

How to save UserId and use it my entire application

$
0
0

Hi,

In login.aspx.cs, I have assign session variables like as follows, both id and branchId has vales while debug,

HttpContext.Current.Session["userId"] = objusr.Id;  
HttpContext.Current.Session["branchId"] = objusr.BranchId;

If i am accessing these session variable on another page it shows empty.

int BId = Convert.ToInt32(HttpContext.Current.Session["branchId"].ToString()); // It shows 0 while debug

How to maintain and access these Id's to my whole application in asp.net 4.0

Is it anyother way?


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>