Click here to Skip to main content
15,884,975 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am working on a asp.net project and run my project on localhost iis server on my pc . My default login page url is
"http://192.168.1.10:8087/login.aspx"
. when i login successfully then its goes to home page
"http://192.168.1.10:8087/home.aspx"
. but some time it's add a random string in my url after login like:
"http://192.168.1.10:8087/(X(1)F(NvzZqZwj50XGSo4q7kRfvICiGB2sjw0Li_75F8-x8tnZsmYLirQ6TQ7FE6W7w37N0))/home.aspx"

because of this searching is not working in my application. i don't know what is the reason of this problem. Can someone help me.

What I have tried:

i am string on google but not getting any solution of this problem.

here is my login page code:-

Protected Sub Login_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login.Authenticate


Dim mprov As Veer.Membership.VeerMembershipProvider = Membership.Provider
Dim bool As Boolean = mprov.ValidateUser(Login.UserName, Login.Password)
Dim uname() As String = Roles.GetRolesForUser(Login.UserName)
If bool Then
If role.Count > 0 Then
e.Authenticated = Roles.IsUserInRole(Login.UserName, uname(0))

End If
End If
If e.Authenticated Then
Session("User") = DirectCast(Membership.Provider, Veer.Membership.VeerMembershipProvider).GetUser(Login.UserName, True)
Session("role") = role(0)
End If
End Sub




Protected Sub Login_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login.LoggedIn

Dim rol As String = Session("role").ToString
Session("Host") = HttpContext.Current.Request.Url.Host
Response.Redirect(Veer.Utility.dbutility.HomePage(rol))

End Sub
Posted
Updated 18-Jan-18 22:07pm
v2
Comments
OriginalGriff 17-Jan-18 6:24am    
Show us the relevant code fragments: We can't tell anything useful from just the output.
F-ES Sitecore 17-Jan-18 6:28am    
The problem is that cookieless sessions are being enabled. We can't say why that is happening on your site, but if you google "asp.net cookieless session" it will at least give you a starting point, maybe find other people who have had the same problem and solved it.
TCS54321 17-Jan-18 6:33am    
here is my login page code:-

Protected Sub Login_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login.Authenticate


Dim mprov As Veer.Membership.VeerMembershipProvider = Membership.Provider
Dim bool As Boolean = mprov.ValidateUser(Login.UserName, Login.Password)
Dim uname() As String = Roles.GetRolesForUser(Login.UserName)
If bool Then
If role.Count > 0 Then
e.Authenticated = Roles.IsUserInRole(Login.UserName, uname(0))

End If
End If
If e.Authenticated Then
Session("User") = DirectCast(Membership.Provider, Veer.Membership.VeerMembershipProvider).GetUser(Login.UserName, True)
Session("role") = role(0)
End If
End Sub




Protected Sub Login_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login.LoggedIn

Dim rol As String = Session("role").ToString
Session("Host") = HttpContext.Current.Request.Url.Host
Response.Redirect(Veer.Utility.dbutility.HomePage(rol))

End Sub
Patrice T 17-Jan-18 13:38pm    
Use Improve question to update your question.
So that everyone can pay attention to this information.

As mentioned in the comments, this is because you have set your Session State to be Cookieless. This means that instead of sending a cookie that has the session id so your server can keep track of clients, it is including the session id in the url.

See [^] for more info.
 
Share this answer
 
i am adding
<sessionState cookieless="false" />
in my config file and it's not working for me.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900