Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I have asp.net website in c#.

Where user is working,it suddenly logout the user.

my code:
DateTime tempdt = Convert.ToDateTime(util.LongDateTimeFormat);

                            tempdt = tempdt.AddHours(+23);
 
                        MySession.Current.AdminConnectedDateTime = Convert.ToDateTime(tempdt);
                        Response.Redirect("InnerMain.aspx");


the requirement is, till the user won't loggout it should not logout the user.

Can any one, please help me.

Thanks
Posted

Hi,

This article has you need:
Alert Session Time out in ASP.NET[^]

Regards,
Praneet
 
Share this answer
 
1.In your web.config, sessionState setting you should set the timeout attribute to a bigger value like in the next example, where the value is 24 hour =1440 minutes (normally no user will stay longer then 24 hours on a site):
HTML
<sessionstate mode="InProc" cookieless="false" timeout="1440" />

2.You could find more details about this sessionState setting in MSDN[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900