Asp.net Session Süresini Öğrenme (Session.Timeout)
Asp.net ile yapılan bir uygulamada Session.Timeout süresini öğrenebiliriz ama Session.Timeout ne ki ? diyorsanız kısaca açıklayım “yaptığınız uygulamalarda sisteme giriş yapanların oturumlarının açık kalma süresidir” . Uygulamamızda bir session tanımlayıp süresini öğreneceğiz. Uygulama sonucunda bize 20 değeri gelecektir eğer siz bir düzenleme yapmaz iseniz asp tarafından 20dk standart olarak tanımlanır.
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Page_Load(object sender, System.EventArgs e) { Session["aspnetornek"] = "Session timeout Süresini Öğrenme..."; Label1.Text = "Session hazırlanıyor...<br />"; Label1.Text += "Session Timeout[Dakika]: " + Session.Timeout; Label1.Text += "<br />Konumuz : " + Session["aspnetornek"]; } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>asp.net session Timeout örnekleri:www.aspnetornekleri.com</title> </head> <body> <form id="form1" runat="server"> <div> <h2 style="color:Red">asp.net session örnekleri: Session Timeout</h2> <asp:Label ID="Label1" runat="server" Font-Size="Large" ForeColor="CornflowerBlue" > </asp:Label> </div> </form> </body> </html>