IssueDate Property

RolePrincipal.IssueDate Property


Gets the date and time that the roles cookie was issued.

Namespace:   System.Web.Security
Assembly:  System.Web (in System.Web.dll)

public DateTime IssueDate { get; }

Property Value

Type: System.DateTime

The DateTime that the roles cookie was issued.

The following example displays role-caching information for the current user if role management is enabled. For information on enabling role management, see the Roles class.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Security" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<script runat="server">

public void Page_Load()

    RolePrincipal r = (RolePrincipal)User;

    IsCachedLabel.Text     = r.IsRoleListCached.ToString();
    CacheChangedLabel.Text = r.CachedListChanged.ToString();
    ExpiredLabel.Text      = r.Expired.ToString();
    VersionLabel.Text      = r.Version.ToString();
    IssueDateLabel.Text    = r.IssueDate.ToString();
    ExpireDateLabel.Text   = r.ExpireDate.ToString();
    CookiePathLabel.Text   = r.CookiePath;

    Msg.Text = "";
  catch (InvalidCastException)
    Msg.Text = "User is not of type RolePrincipal. Are roles enabled?";


<html xmlns="" >
<title>Role Information</title>

<form id="form1" runat="server">

  Role Information for <b><%=User.Identity.Name%></b>.<br />

  <asp:Label id="Msg" runat="Server" ForeColor="maroon" /><br />

  <table border="1" cellpadding="4" cellspacing="4">
      <td><asp:Label id="IsCachedLabel" runat="Server" /></td>
      <td><asp:Label id="CacheChangedLabel" runat="Server" /></td>
      <td><asp:Label id="ExpiredLabel" runat="Server" /></td>
      <td><asp:Label id="VersionLabel" runat="Server" /></td>
      <td><asp:Label id="IssueDateLabel" runat="Server" /></td>
      <td><asp:Label id="ExpireDateLabel" runat="Server" /></td>
      <td><asp:Label id="CookiePathLabel" runat="Server" /></td>



.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft