Women in Technology

Hear us Roar



Article:
  ASP.NET Forms Authentication, Part 2
Subject:   Force AD Login in asp.net from all pages.
Date:   2005-09-19 23:24:41
From:   najeemmillyas
Response to: Force AD Login in asp.net from all pages.

Hi,

You may set a session variable immediately after login success.Also you may chech the session set or not while a page is accessing.If session session not set then redirect the user to login page

Sample code

'login.aspx:

'after athentication success

session("sess_var")="36136jdasd"


'under page load event of protected page

if (Session("sess_var")="")

Response.redirect("login.aspx")

End if

place the above code in any page u need to protect.

Regards,

Najeem

http://www.najsoftindia.com