Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Session Is Nothing when machine name mentioned in address bar

Session Is Nothing when machine name mentioned in address bar

Scheduled Pinned Locked Moved ASP.NET
sysadminhelpworkspace
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sasidar_d
    wrote on last edited by
    #1

    Hi Techies, I am very much surprised by the behaviour of the sessions. Let me explain them. I am retrieving the user name of the windows User by User.Identity and then saving it in a session. The once i click the login button, it should write as "Login Sucess". The Code Snippet is as follows : 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 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 End If Catch ex As Exception Me.lblstatus.InnerText = ex.Message End Try End Sub Private Function getLoginDomainUser() As String Dim strUser As String Try strUser = User.Identity.Name 'With Domain Name Catch ex As Exception Throw ex End Try End Function I have created the msi file using setup and deployment project and then installed in the windows 2000 Server. The application works fine when i use the following url http://localhost//login.aspx or http:////login.aspx THE PROBLEM IS HERE when i give the machine name instead of ip , the session is getting empty and then i am not login The same setup is working fine with windows 2000 Professional. Can anybody tell me the reason for this peculair behaviour of the session I am hanging around this problem for more than 2 days . . . . Thanks in advance Sasidar

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups