Context.user not retaining it's value

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
 
S

S. Justin Gengo

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
 
J

John Kraft

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top