Re: Session variables with forms based authentication
From: Morten (morten_skovgaard_at_hotmail.com)
Date: 05/08/04
- Next message: Vijaye Rajji: "Re: Custom ToolBar?"
- Previous message: Marek: "Re: static constructor and multithreading"
- In reply to: matt: "Re: Session variables with forms based authentication"
- Next in thread: Jason DeFontes: "Re: Session variables with forms based authentication"
- Reply: Jason DeFontes: "Re: Session variables with forms based authentication"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 8 May 2004 11:53:52 +0200
Hi Matt!
Thanks for your suggestion. The problem is that I don't get the user name
until after I've logged in and one of the session variables depends on the
properties of the user. The Session_OnStart fires a bit too early...
Best regards
Morten
"matt" <zz1_@_tiscali.fr> wrote in message
news:409b90f8$0$12743$636a15ce@news.free.fr...
> Hi,
>
> Morten wrote:
>
> > Hi!
> >
> > I've been implementing forms based authentication in a web project. It
> > works pretty good. When I log on by clicking the "login" button the
> > following code is executed:
> >
> > if (ValidateUser(strUserName,txtUserPass.Value))
> ...
> > This as you can see sets a couple of session variables. The problem is
> > that I've made it possible to use a persistent cookie so that users
don't
> > have to key in their credentials everytime they log in.When the cookie
is
> > used users are granted access immediately and the code above is not used
> > and therefore the session variables are not initialized.
>
> You can define the method "Session_OnStart" il the global.asax file that
> will automatically execute needed code for cookie checking and session
> variables initialization.
>
> Hope this will help you.
>
> Matt
- Next message: Vijaye Rajji: "Re: Custom ToolBar?"
- Previous message: Marek: "Re: static constructor and multithreading"
- In reply to: matt: "Re: Session variables with forms based authentication"
- Next in thread: Jason DeFontes: "Re: Session variables with forms based authentication"
- Reply: Jason DeFontes: "Re: Session variables with forms based authentication"
- Messages sorted by: [ date ] [ thread ]