Re: FormsAuthentication and Session
- From: Lucas Tam <REMOVEnntp@xxxxxxxxxx>
- Date: Mon, 01 Aug 2005 19:54:52 GMT
"Joe" <J_no_spam@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in
news:#bjIadslFHA.320@xxxxxxxxxxxxxxxxxxxx:
> I'm using FormsAuthentication and need to track a user id (int) along
> with the user name. I was trying to store the user id under the
> Session but if the user closes the browser and opens another browser
> and goes back to the page the user is still logged in.
>
> I have 2 choices:
> 1 - Log the user out whenever the browser is closed
> 2 - Store the user id in a cookie.
>
> I would prefer option 1 but I don't know how to Sign out the user when
> the browser is closed and the session is no longer valid.
You can extend the IPrincipal and IIdentity
(FormsIdentitiy/GenericIdentity) interfaces to add custom data to your
user clasess.
This page sort of explains the process and does a bit more too:
http://www.codeproject.com/aspnet/rolesbasedauthentication.asp
--
Lucas Tam (REMOVEnntp@xxxxxxxxxx)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
.
- References:
- FormsAuthentication and Session
- From: Joe
- FormsAuthentication and Session
- Prev by Date: Re: Saved HTM File not displayed correctly
- Next by Date: Re: Content Expiration Question
- Previous by thread: FormsAuthentication and Session
- Next by thread: Re: FormsAuthentication and Session
- Index(es):
Relevant Pages
|