I am making a application in asp.net which has a login function. To acess the current user info i am passing the user email with the Redirect function like
Session["email"] = TextBox1.Text;
Response.Redirect("home.aspx?Id=" + Session["email"]);
By this i am getting my next page as home.aspx?Id=example@example.com
In this home.aspx page i am getting the value from page_load function like this
string url = HttpContext.Current.Request.Url.AbsoluteUri;
Uri myUri = new Uri(url);
keyid = HttpUtility.ParseQueryString(myUri.Query).Get("Id");
The problem is when a user paste a direct url of any user it allows them to access their account. Is there away to redirect such users to login page.
[The user who comes in from login page only able to acess the account]
I googled a lot but i cant able to find answers for this. Anyone knows the solution for this?