468,242 Members | 1,705 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

HttpContext.Current.User is it unique?

Hi,

Is HttpContext.Current.User unique for each visitor or is it shared
across an application?

Have some problems that might have to do with this and found
contradictory answers on this question.

Thanks!
Feb 2 '06 #1
6 2360
It's taken from HTTP headers (the docs say HTTP request), so yes it
should be unique and will be taken from IIS's authentication.

Feb 2 '06 #2
Chris S. > It's taken from HTTP headers (the docs say HTTP request), so
yes it
should be unique and will be taken from IIS's authentication.


Thanks.
Although it didn't solve my problem I now know where not to look.

Feb 2 '06 #3
HttpContext represents the context of particular Http request.
User property is responsible for authorized visitors. That is if users load web app with anonymous auth.

Then afaik you will have the same user, but many visitors.

You can use Session property of Page class. Session is unique for each visitor. A combination if Session and HttpContext can be used
to distinguish between visitors with the same auth.

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

"Sjaakie" <ke**@secret.it> wrote in message news:43***********************@news.xs4all.nl...
Hi,

Is HttpContext.Current.User unique for each visitor or is it shared
across an application?

Have some problems that might have to do with this and found
contradictory answers on this question.

Thanks!
Feb 2 '06 #4
The context is unique to the current request and bound to each individual
user session when the request begins, until the request completes and the
response is returned when the context then goes out of scope.
--
Regards

John Timney
Microsoft MVP

"Sjaakie" <ke**@secret.it> wrote in message
news:43***********************@news.xs4all.nl...
Hi,

Is HttpContext.Current.User unique for each visitor or is it shared across
an application?

Have some problems that might have to do with this and found contradictory
answers on this question.

Thanks!

Feb 2 '06 #5
It's taken from a HTTP header as the headers collection will show you.

Feb 2 '06 #6
Chris S. schreef:
It's taken from HTTP headers (the docs say HTTP request), so yes it
should be unique and will be taken from IIS's authentication.


Maybe you have a clue what's causing this ...

I built a site with custom formsauthentication which acts pretty weird
for some people. These (3) people have in common that their surnames are
'Doe' and that all 3 live in Hong Kong. Login, email and passwords differ.
Authentication is based on a combination of login and password. If both
match with values in database an authenticationticket is generated and
stored into a cookie.

Userdetails are queried from the database using
HttpContext.Current.User.Identity.Name-value as login. Which should be
the login of the current user.
Somehow these 3 people all see the userdetails of one particular mister
Doe. Checked my procedures multiple times to make sure I didn't store
credentials into the application cache, which wasn't the case.

Could it be possible the server is caching the Identity.Name?
Or could this have to do with some sort of proxy-server?
Or something else....
Feb 3 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by coollzh | last post: by
4 posts views Thread by Makarand Keer | last post: by
15 posts views Thread by Jason | last post: by
3 posts views Thread by Madhur | last post: by
reply views Thread by =?Utf-8?B?QW50b25pbyBPJydOZWFs?= | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.