473,624 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 virtualdirector y 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.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
Try
If Not Page.IsPostBack Then
Me.lblstatus.In nerText = "Post back occured "
Session("UserID ") = getLoginDomainU ser()
Me.txtUserID.Va lue = Session("UserID ")
End If

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

Private Sub btnLogin_Server Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnLogin.Server Click
Try
If Not Session("UserID ") Is Nothing Then
If Me.txtUserID.Va lue = Session("UserID ").ToString Then
Me.lblstatus.In nerText &= "Logged Successfully"
Else
Me.lblstatus.In nerText &= "Login Failed "
End If
Else
Me.lblstatus.In nerText &= "Session Empty "
End If

Catch ex As Exception
Me.lblstatus.In nerText = ex.Message
End Try
End Sub
Private Function getLoginDomainU ser() As String
Dim strUser As String
Dim intPos As Int16
Try

strUser = User.Identity.N ame 'With Domain Name

If strUser.Trim <> "" Then
Me.lblstatus.In nerText = Me.lblstatus.In nerText
intPos = Convert.ToInt16 (InStr(strUser, "\"))
domainName = Mid(strUser, 1, intPos - 1)
loggedUser = Mid(strUser, intPos + 1)
getLoginDomainU ser = 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 1017

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

Similar topics

15
4379
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 session variables , or an store an array in a session variable, but what I wanna do is store it all in a class so I can use property get and property let.
6
2383
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 email from (possibly) three seperate forms. the following code is the end of a routine which stashes data from the first form off to session variables and then redirects itself to the proper form / procedure depending upon the state of two...
9
2087
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 Gmail, they all SSL the login scripts and then use regular http for everything else, which I'm sure speeds things up without the encrypt/decrypt process. I was going to change my scripts to reflect this model, but I saw in the php manual the...
38
2545
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 lead(I have just started working) he said we should not use dynamic allocation in real time systems, the code will not run in predictable time period.Can anybody tell what does he mean?Why the execution time becomes unpredictable? Thanks
1
1010
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 sitting a number of tests for about one to two hours. the problem is that every now and then the session objects gets lost - I check the Session("User_Id") on
31
6988
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 using Session variables for three years now and i'm entering a project with my new boss who has never quite come around that session variables are ok. What's the concensus here. How can i convince him that they are ok in ASP.NET. OR
10
12191
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 an object that stores the user's basic profile data (username, user type, associated sales region, etc.). I've been taking this user info and placing it in the Session object like so... Session = user;
8
1740
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 viewstate, to session, and on the details page back to viewstate. Or does that sound like too much work? thanks, ari
43
3410
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
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.