472,981 Members | 1,273 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,981 software developers and data experts.

Problem with Session Variable

Hello:

This was posted in a wrong forum; that's why I am posting here again. Sorry.

I just wrote my first ASP.Net application, tested it on my development
environment and deployed it on a production server. That's when I encountered
a problem. The anonymous access is turned of and Integrated Windows
Authentication is turned on.

In my Global.ASCX, I have coded the Session_Start event
1. I read Request.ServerVariables("Auth_User")
2. Save it as a variable, userid, in the session variable.

Here is the problem:

1. User A signs in and the screen shows that the userid is "User A".
2. User B signs in through another workstation and his user ID shows "User
A" when in fact it should show "User B".

I thought the session is private to the user?

I got feedback that I should not do anything in Global. Also, setting
session variables in the Session_start event is loopy!

Can somebody tell me what I am doing wrong?

Venki

Nov 19 '05 #1
3 1323
strage... not sure if this will be of any help.. you may want to check if
you are using any static variables to assign this value later in some
pages/assembly.. I have seen similar issue with session values getting mixed,
when using a STATIC variable ..

"vvenk" wrote:
Hello:

This was posted in a wrong forum; that's why I am posting here again. Sorry.

I just wrote my first ASP.Net application, tested it on my development
environment and deployed it on a production server. That's when I encountered
a problem. The anonymous access is turned of and Integrated Windows
Authentication is turned on.

In my Global.ASCX, I have coded the Session_Start event
1. I read Request.ServerVariables("Auth_User")
2. Save it as a variable, userid, in the session variable.

Here is the problem:

1. User A signs in and the screen shows that the userid is "User A".
2. User B signs in through another workstation and his user ID shows "User
A" when in fact it should show "User B".

I thought the session is private to the user?

I got feedback that I should not do anything in Global. Also, setting
session variables in the Session_start event is loopy!

Can somebody tell me what I am doing wrong?

Venki

Nov 19 '05 #2
Venki,

could you post your code. This would make it much easier to help you!
Nevertheless from what you write it seems to me that you want to write your
onw authentication code. Check out the authentication part of your web
config. You can get a first impression by reading
http://www.15seconds.com/issue/020220.htm

Does this help?

Best regards

Daniel Walzenbach
"vvenk" <vv***@discussions.microsoft.com> schrieb im Newsbeitrag
news:42**********************************@microsof t.com...
Hello:

This was posted in a wrong forum; that's why I am posting here again.
Sorry.

I just wrote my first ASP.Net application, tested it on my development
environment and deployed it on a production server. That's when I
encountered
a problem. The anonymous access is turned of and Integrated Windows
Authentication is turned on.

In my Global.ASCX, I have coded the Session_Start event
1. I read Request.ServerVariables("Auth_User")
2. Save it as a variable, userid, in the session variable.

Here is the problem:

1. User A signs in and the screen shows that the userid is "User A".
2. User B signs in through another workstation and his user ID shows
"User
A" when in fact it should show "User B".

I thought the session is private to the user?

I got feedback that I should not do anything in Global. Also, setting
session variables in the Session_start event is loopy!

Can somebody tell me what I am doing wrong?

Venki

Nov 19 '05 #3
Daniel:

Here is the code from Global.ASPX:

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
End Sub

Sub Session_Start(ByVal Sender As Object, ByVal E As EventArgs)

Dim lbOutcome As InnoBox_BO.User._Outcome

loUser = InnoBox_BO.User.GetInstance
loUser.DBConnString = ConfigurationSettings.AppSettings("DSN1")
Try
lbOutcome =
loUser.CreateByUserID(Request.ServerVariables("Aut h_User").ToUpper)
Catch ex As Exception
Server.Transfer("Errors.aspx")
End Try
Session("User") = loUser
Session("DSN1") = ConfigurationSettings.AppSettings("DSN1")
Session("DSN2") = ConfigurationSettings.AppSettings("DSN2")

End Sub

In addition, each form has a Init event coded to make sure that the object,
UserID is available (I am giving an example of one such form):

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()

Dim lbOutcome As InnoBox_BO.User._Outcome
Dim loUser As InnoBox_BO.User

If Session("User") Is Nothing Then
loUser = InnoBox_BO.User.GetInstance
Try
lbOutcome =
loUser.CreateByUserID(Request.ServerVariables("Aut h_User").ToUpper)
Catch ex As Exception
Server.Transfer("Errors.aspx")
End Try
loUser = Session("User")
End If
If Session("User").FirstName = Nothing Or Session("User").LastName =
Nothing Then
Server.Transfer("MyProfile.aspx")
End If
End Sub

Thanks for our help
Venki

"Daniel Walzenbach" wrote:
Venki,

could you post your code. This would make it much easier to help you!
Nevertheless from what you write it seems to me that you want to write your
onw authentication code. Check out the authentication part of your web
config. You can get a first impression by reading
http://www.15seconds.com/issue/020220.htm

Does this help?

Best regards

Daniel Walzenbach
"vvenk" <vv***@discussions.microsoft.com> schrieb im Newsbeitrag
news:42**********************************@microsof t.com...
Hello:

This was posted in a wrong forum; that's why I am posting here again.
Sorry.

I just wrote my first ASP.Net application, tested it on my development
environment and deployed it on a production server. That's when I
encountered
a problem. The anonymous access is turned of and Integrated Windows
Authentication is turned on.

In my Global.ASCX, I have coded the Session_Start event
1. I read Request.ServerVariables("Auth_User")
2. Save it as a variable, userid, in the session variable.

Here is the problem:

1. User A signs in and the screen shows that the userid is "User A".
2. User B signs in through another workstation and his user ID shows
"User
A" when in fact it should show "User B".

I thought the session is private to the user?

I got feedback that I should not do anything in Global. Also, setting
session variables in the Session_start event is loopy!

Can somebody tell me what I am doing wrong?

Venki


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nick Whitelegg | last post by:
Hello, I'm having an odd problem with combining an authentication session variable with header() redirection. Basically I have an authentication script which checks a username/password. If the...
1
by: Jonathan Chong | last post by:
I have problem with AOL browser (IE and Netscape are OK) accessing my Web site after putting up a load balancer that will go to W1 or W2. The problem does not happen when there is only Web server...
3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
1
by: farooqazeem | last post by:
Hi guys, I’m facing some problem can u solve it. Problem is: I’m giving user Id and password in (Login_sess.asp) and submit it to page (sess_test.asp). I am setting session variable...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
3
by: Philip Tepedino | last post by:
I'm having an odd problem. My website's session state is getting shared between users! This problem only happens when a user tries to access the site from inside our corporate LAN. The user,...
4
by: N. Demos | last post by:
Hello, I'm learning ASP.NET, and am having a strange problem with some example code from the book I'm using. The code increments and displays the value stored in a session variable when the "Add"...
13
by: Simon Matthews | last post by:
I am having issues with the right way to architecture the following (using c# asp.net):- The question I have is how best pass the collected data from one web page for use in another. The...
8
by: Nacho | last post by:
Hello people I have the following problem I have a private area in my site. The user enters the username and password, then clicks "enter" and the session is created and also a session...
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=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 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: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.