ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 12th, 2003, 12:05 AM
andreasg60 andreasg60 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 12 andreasg60 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP Session

Hello,

I'm controlling my login page usign session.

My problem is that i test my script in more than 5 windows servers : XP professional, Win 98 Personal web server, and advance 2000 server and is working fine.

When i uploaded my script to my webhost account it seems sessions are not working.

To understand better what i'm doing i copy my login script below:


============================================
Login.asp
============================================

<%
Response.Buffer = True
Response.Expires = -1000
Const LoginButton = "Login"
%>
<!-- #include file=connect.inc -->
<%
If Request("Action") = LoginButton Then
Set DB = Connect()
SQL = "SELECT * FROM Login WHERE Username = '" + Request("Username") + "'"
Set RS = DB.Execute (SQL)

If (RS.EOF And RS.BOF) Then
Session (SiteID + "Authentication") = False
Response.Redirect ("default.asp?Error= Username+does+not+exist.")
ElseIf RS("Password") <> Request ("Password") Then
Session (SiteID + "Authentication") = False
Response.Redirect("login.asp?Error=Invalid+Password")
Else
Session (SiteID + "Username") = RS("Username")
Session (SiteID + "FName") = RS("FName")
Session (SiteID + "LName") = RS("LName")
Session (SiteID + "Authentication") = True
Response.Redirect ("menu.asp")
End If
End If
%>


==============================================


Now you can see above if the login is correct will redirect you to menu.asp if not to the login.asp (same page) and display the error.

When i'm trying to login now is redirecting me always to default.asp and i'm getting page not found.

This is happens only to my external hosting account, in my servers locally is working fine. Also i uploaded it to some free asp hosts and was also working fine.

Is anybody familiar with this problem. Its very strange to me.

Thanks for your help / suggestions.

Andreas

Reply With Quote
  #2  
Old April 12th, 2003, 02:41 AM
imbrokn imbrokn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: NJ
Posts: 428 imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 15
Send a message via AIM to imbrokn
Perhaps you best bet is to talk to whoever hosts your site. It clearsly sounds like an issue with the server and not with your code. If you tested it in five other places and it worked fine then most likely it is the way the servers are set up. Perhaps the disable session for performance increase? I also beleive that there is an issue with session and clusters of web servers. Perhaps there is a way around it, but i don't know too much about it, i just remember reading it. Who is your host? is it a reputable place?

Reply With Quote
  #3  
Old April 12th, 2003, 03:01 AM
ngibsonau ngibsonau is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 138 ngibsonau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
Not that we don't believe you but before you blame the provider I would do a few tests. Eg are you sure you html form has an input named "Username". You may have it locally but is the live one identicle? Does the live database have any data. I would like to see the output of the next two queries.

Code:
SQL = "SELECT * FROM Login WHERE Username = '" + Request("Username") + "'"

response.write SQL & "<br>"
Set RS = DB.Execute (SQL)
While NOT rs.EOF
  response.write rs("Password") & "<br>"
  rs.moveNext
Wend


Code:
SQL = "SELECT * FROM Login"
Set RS = DB.Execute (SQL)
While NOT rs.EOF
  response.write rs("Password") & "<br>"
  rs.moveNext
Wend


I'm sure this will give you enough information to find out whats going on. If it doesn't check what version of IIS and ASP the live server is using.
__________________
--

ngibsonau

Reply With Quote
  #4  
Old April 12th, 2003, 06:35 AM
andreasg60 andreasg60 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 12 andreasg60 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re

Thanks for your reply,

My html code is working fine.

My field is named username.

Also if their are no data in databasei'm writing the error in html:

<%= Request("Error") %>

so if username is not found or is empty it will show Username does not exist if the username found and match it will check for password and if not match it will write password does not exist.

All this are working fine. I bet is something wrong with their server.

Thanks

Last edited by andreasg60 : April 12th, 2003 at 07:00 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > ASP Session

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap