469,616 Members | 1,620 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,616 developers. It's quick & easy.

smart way to set "timeout" security

31
hi all,

I am developing a system using asp.net(c#). I am using "left" "top" & "Middle" design in my system. I want to set a time out mechanism. when the user has expired the configured time the user is derected to a tomeout mesassage page.

at the moment i am using fillowing code in page load metod in all middle pages.

if (Session["UserId"] != null)
{
if (!IsPostBack)
{
////
//// necessry methods
////
}
}

else
{
Server.Transfer("TimeOutMessage.aspx");

}


can anyone propose another smart way to do this?

Thanx

Anushka
Oct 12 '07 #1
1 1098
Shashi Sadasivan
1,435 Expert 1GB
Hi,
Your code is almost pretty much necessary for each page that you create (except the login screen ofcourse)
You dont want people to bookmark pages and think that they can just get in without logging in later on.

To expire a session you can set its properties during the time you create the session. So the moment the session expires it would become null and then any postback even being triggered would transfer the user to the login page
Oct 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Nils Magnus Englund | last post: by
3 posts views Thread by Nils Magnus Englund | last post: by
3 posts views Thread by Agnes | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.