G
Gilles
Hi,
I'm using a custom HttpModule.
Implementation as follow:
internal class CustomHtttpModule:IHttpModule
{
public void Init(HttpApplication app)
{
app.AuthenticationRequest += new EventHandler(OnAuthenticate);
}
private void OnAuthenticate(object sender, EventArgs e)
{
HttpContext context = HttpContext.Current;
HttpCookie httpCookie =
context.Request.Cookies[FormsAuthentication.FormsCookieName];
if (httpCookie != null)
{
FormsAuthenticationTicket ticket =
FormsAuthentication.Decrypt(httpCookie.Value);
if (ticket!=null)
{
CustomPrincipal user = new CustomPrincipal(ticket);
System.Web.HttpContext.Current.User = user;
}
}
}
}
Authentication works but i'm losing Session when i try to enter in a
Web Site.
Can you help?
I'm using a custom HttpModule.
Implementation as follow:
internal class CustomHtttpModule:IHttpModule
{
public void Init(HttpApplication app)
{
app.AuthenticationRequest += new EventHandler(OnAuthenticate);
}
private void OnAuthenticate(object sender, EventArgs e)
{
HttpContext context = HttpContext.Current;
HttpCookie httpCookie =
context.Request.Cookies[FormsAuthentication.FormsCookieName];
if (httpCookie != null)
{
FormsAuthenticationTicket ticket =
FormsAuthentication.Decrypt(httpCookie.Value);
if (ticket!=null)
{
CustomPrincipal user = new CustomPrincipal(ticket);
System.Web.HttpContext.Current.User = user;
}
}
}
}
Authentication works but i'm losing Session when i try to enter in a
Web Site.
Can you help?