I have an asp.net code behind file with the following code:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (User.Identity.IsAuthenticated)
{
The piece of code that comes after is used to render some controls and should only be visible to authenticated users; I'm using asp.net Identity.
My question is this: should I leave my code as is or would it be more secure to rewrite it like this:
protected void Page_Load(object sender, EventArgs e)
{
if (User.Identity.IsAuthenticated)
{
if (!IsPostBack)
{