hi friend,
Scenario:
When I login into Login Page, i creating session of respective user name and redirect into their homepage and i was checking session value in Page Load Event. If session value is there then load or not.
Problems:
1) When i pasted url address of Hom page directly into address bar, its shows Homepage and not redirect into Login Page,
its not checking session value but when i refresh then redirect into login page.
2) and also when i login into page and after logout then i clicked back/forward button on Browser, its showing last accessed pages but i want to be redirect only login page after logout button clicked.
Here my logout code:
Session.Abandon();
Response.Redirect("/Login.aspx");
Please Help me, its urgent
Thanks in advance
Regards
Tekk
Loading
Kapil Deo MalhotraPosted Jun 7, 2010, 1:48 PM
Can you share the code for the 1st issue? How you are checking the session value?
For Second problem you can use the following in Logout code.
Session.Abondon();
Response.Cookies.Clear();
FormsAuthentication.SignOut();
Response.Redirect("../xyz.aspx");
on Page_Load()
Response.Cache.SetNoStore();
this can solve back button problem
Hope this will help.
"Don't forget to mark this as Answer"
Abhimanyu K VatsaPosted Jun 12, 2010, 5:03 AM
authentication mode
::::::::::::::::::::::::::
::::::::::::::::::::::::::
secure area for which u required login and session
::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::
I hope it will help you !
Abhimanyu K VatsaPosted Jun 12, 2010, 5:03 AM
authentication mode
::::::::::::::::::::::::::
::::::::::::::::::::::::::
secure area for which u required login and session
::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::
I hope it will help you !
tekkPosted Jun 8, 2010, 2:06 AM
Thanks for reply.
Your code really helps me. Both issues are solved Thanks a lot.
Here my session value checking value in page load event() Code:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["username"] != null)
{
Fuctionality code....
}
else
{
Response.Redirect("/login.aspx");
}
}