472,789 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

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 2644
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan Bart | last post by:
I am using an application which is a modification of IBuySpy Portal. It is using Forms authentication. Users login and their name is added to Context Then I use: ...
5
by: coollzh | last post by:
who can tell the detailed difference of: HttpRuntime, Context, HttpContext.Current sometimes, we can use Context Object instead of HttpContext.Current; sometimes, we can user HttpRuntime...
10
by: kiran_s_rao | last post by:
I have a serious issue that seems to be intermittent with User.Identity.Name. In an environment where about 100+ users are logging on to a site with forms authentication, calling ...
4
by: Makarand Keer | last post by:
Hi All I have problem in using Threading. I have ASP.NET application in which I am using multithreading to start a process. Now the object instances which are used in this thread access...
15
by: Jason | last post by:
Currently, I am storing information about the currently logged on user in Session variables that are stored in SQL. However, I am using role-based security, so I am storing custom roles in a...
4
by: Doogie | last post by:
Hi, I am using HttpContext.Current.User.Identity.Name to get a user id from a web application. I then use that as part of a name of a cookie I'm writing. 30 minutes later I do a refresh of this...
3
by: Madhur | last post by:
Hello I am delivering an asp.net 2.0 application to my customer. I need to know, If I need to check for the condition of HttpContext.Current to be null in my business logic. I have extensively...
0
by: =?Utf-8?B?QW50b25pbyBPJydOZWFs?= | last post by:
We changed a username in AD. The user now logs on to a computer on our network using the new username without any problems. They can not logon using the old username. However, when they access a...
13
by: bproddu | last post by:
Hi, I'm using Forms authentication for my web app. I've a custom Principal class that I would like to set to the HttpContext.Current.User after the Membership.ValidateUser() passes. I'm able to...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.