Context.user not retaining it's value

  • Thread starter Thread starter John Kraft
  • Start date Start date
J

John Kraft

I'm attempting to use the context.user object. In my login code, I add
an identity to the context.user. I can use the debugger to watch it
stuff the identity into the context.user object, but when I later try to
check the context.user.identity.name it contains the empty string ("").

Does anyone know why this would be the case?

John
 
John,

The context object is recreated every page load.

Are you trying to use it later in the code, on a different page, or on
postback to the same page?

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
John said:
I strongly suggest you look into Forms Authentication (see "Forms
Authentication Provider" at
http://msdn.microsoft.com/library/d...pconformsauthenticationacrossapplications.asp).

When you do, I also strongly suggest that you first forget everything you
know about the technique you were trying to use. Then, once you understand
Forms Authentication, you can see how it relates to what you've got now.
I've seen too many attempts to twist Forms Authentication into something it
wasn't meant to do, rather than learn what it actually does.

Ok... I appreciate you pointing me at that site. I've read it. It
pretty much makes sense, and our forms auth is working as advertised.

Now... to do what I wish to do... in theory... all I should have to do
is authenticate the user myself in my little login box, and then add a
cookie to the system.

Isn't this correct?

Well, it won't let me add a cookie to the system.
Response.cookies.add() doesn't seem to work from my little control.

Argh???

John
 
Back
Top