0

hii,
i m facing problem in logout code in asp.net c#.
please give the code which can do:-
1) session end
2) when pressing back button after logout it should be redirect to login page.
3)by pasting url of somebody's account in address bar it should not enter in the account and redirect to login page.

please provide code for both "session" and "authentication" method.
thank you for your time..

4
Contributors
6
Replies
11
Views
7 Years
Discussion Span
Last Post by thewebhostingdi
0

hi...,
it is very common problem...
u can use
session destroy, session time out method ,
nd make session null......

0

hi...,
it is very common problem...
u can use
session destroy, session time out method ,
nd make session null......

i already did this, but after logging out when i press back button it redirects to user's account page again..pls help

0

i already did this, but after logging out when i press back button it redirects to user's account page again..pls help

overwrite the value of particular session,
and load the page again,
and check you should filling all data of particular user at page load event.

0

Hai,

you can use the following Code

In Logout Button Click Event

 protected void btnlogout_Click(object sender, EventArgs e)
        {
            Session.Abandon();
            Session.Clear();
            Response.Redirect("LoginPage.aspx");
        }
0

Am facing problem on jscript function that can show a div on button click.
pls smbody help me?

0

For this you can do following :

Check in each page load event if session is active or not!!!
If session is not active then redirect to login page.

And on click event of Logout button destroy/Clear session variable's value.

This will fulfill all your conditions.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.