473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Session becomes nothing when machine address is given

hi techies

I have created a Login web page . It gets the user identity using the
window nt authetication.
The page is working fine. I have removed the allow anonymous access
check box for the virtual directory and then given the check for the
integrated window authetication.

After deploying the project in the testing server - windows 2003 server
(server called as svr10) it is working fine.

But when deployed in the production server which has the same windows
2003 server with iis 6.0 i face the following problem

when i give the url as localhost followed by the virtualdirectory name
and login.aspx , the i am able to login in

But i am not able to login when i give the name of the machine instead
of localhost.

Similarly i am not able to login from the client system also. the
client system is windows 2000 professional with ie 6

After debugging the application i found that the session which i have
used to store the user identity is becoming nothing after post back

The sequence of my code is like this

1) Page load - I retrieve the user identity and store it in a session -
display the same user identity in the text box.
2) Button click event - i am checking for the session and then allowing
to log in, but it fails because the session is nothin

<code snippet>

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Try
If Not Page.IsPostBack Then
Me.lblstatus.InnerText = "Post back occured "
Session("UserID") = getLoginDomainUser()
Me.txtUserID.Value = Session("UserID")
End If

Catch ex As Exception
Me.lblstatus.InnerText = ex.Message
End Try
End Sub

Private Sub btnLogin_ServerClick(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnLogin.ServerClick
Try
If Not Session("UserID") Is Nothing Then
If Me.txtUserID.Value = Session("UserID").ToString Then
Me.lblstatus.InnerText &= "Logged Successfully"
Else
Me.lblstatus.InnerText &= "Login Failed "
End If
Else
Me.lblstatus.InnerText &= "Session Empty "
End If

Catch ex As Exception
Me.lblstatus.InnerText = ex.Message
End Try
End Sub
Private Function getLoginDomainUser() As String
Dim strUser As String
Dim intPos As Int16
Try

strUser = User.Identity.Name 'With Domain Name

If strUser.Trim <> "" Then
Me.lblstatus.InnerText = Me.lblstatus.InnerText
intPos = Convert.ToInt16(InStr(strUser, "\"))
domainName = Mid(strUser, 1, intPos - 1)
loggedUser = Mid(strUser, intPos + 1)
getLoginDomainUser = loggedUser
Else
Throw New Exception(" Authenctication Not Set. Please
Contact Administrator ")
End If
Catch ex As Exception
Throw ex
End Try

End Function
<code snippet>

Not able to find the reason for this peculiar behaviour

Any help is highly appreciated
Thanks

Mar 10 '06 #1
0 1009

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

Similar topics

15
by: | last post by:
Hi, I want to do things this way: I have a bunch of stuff that I want to keep track of while a user is connected to the site. Maybe 50 little peices of information. So I know I can make 50...
6
by: Al Jones | last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate group would you point me toward one that is. Basically, I seem to be losing session data part way though preparing an...
9
by: Marcus | last post by:
Hello, Currently all of my php pages use SSL, not just my initial login. Originally I thought this would be more secure, but after thinking about things and looking at sites like Amazon and...
38
by: vashwath | last post by:
Might be off topic but I don't know where to post this question.Hope some body clears my doubt. The coding standard of the project which I am working on say's not to use malloc.When I asked my...
1
by: Sergey Poberezovskiy | last post by:
Hi, I have an ASP.Net application running on a web farm. I use SessionState = "StateServer" and cookieless mode and session Timeout = 20 mins. This is a testing application where a user will be...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
10
by: GreggTB | last post by:
I've got an page (LOGIN.ASPX) that receives the user's login information. During the page load, it checks the credentials against a database and, if validation is successful, creates an instance of...
8
by: ari | last post by:
hey all, i'm trying to make my app as stateless as possible. is it ok to create a dataset and store in viewstate and whenever the user decides to select a from that dataset, to move from...
43
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.