Get session time out value
SessionTimeout.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">
protected void Page_Load(object sender, System.EventArgs e) {
Session["FavoritePhone"] = "Nokia E61";
Label1.Text = "Session read...<br />";
Label1.Text += "Session Timeout[Minutes]: " + Session.Timeout;
Label1.Text += "<br />Favorite Phone : " + Session["FavoritePhone"];
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>asp.net session Timeout example: how to get session time out value</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:Red">asp.net session example: Session Timeout</h2>
<asp:Label
ID="Label1"
runat="server"
Font-Size="Large"
ForeColor="CornflowerBlue"
>
</asp:Label>
</div>
</form>
</body>
</html>
- How to get whether the session was created only for the current request or not in asp.net
- How to add an item in the session in asp.net
- How to clear the current session data in asp.net
- How to get session id for the current client in asp.net
- How to remove an item from session in asp.net
- How to remove all keys and values from the session-state collection in asp.net