Snippet from normal login:
This page works perfectly for what I need.Code:<!--#include file='includes/dbconnection.inc'--> <!--#include file="includes/md5.asp"--> <!--#include file="includes/register.asp"--> <% strUserName = Replace(Request.Form("txtUserName"), "'", "''") Set rsCheckUser = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT password, ID, username, admin, suspend FROM tblUsers WHERE username ='" & strUserName & "'" rsCheckUser.Open strSQL, adoCon
Later down this page I write a cookie:
Ok, so I make a dumby page to verify the value in the cookie:Code:'set UserID from dbuserid Response.Cookies("User")= rsCheckUser("ID") 'Set expiration Response.cookies("User").expires = date + 30
Which then displays ID=5Code:<% strID=Request.cookies("User") response.write "ID=" & strID <br> response.write strID %>
5 (I wanted to see if I needed the & or not)
Ok, check the database, yes 5 is my ID in it, so dup the code from login and change to match-vs-cookie:
Hmm I seem to have recieved an error:Code:<!--#include file='includes/dbconnection.inc'--> <!--#include file="includes/md5.asp"--> <!--#include file="includes/register.asp"--> <% strID = Request.cookies("User") set rsCheckUser = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT password, ID, username, admin, suspend FROM tblUsers WHERE ID =strID" rsCheckUser.Open strSQL, adoCon
Ok, searched far and wide, seems 90% of my search is saying, not to use a delimiter around strID, wel good cause I aint. The other 10% of the search didn't make much sence to me (alot were links to pages that had that error message...ok I already knew what it looked like, lol)Code:Microsoft JET Database Engine error '80040e10' No value given for one or more required parameters. /logintest.asp, line 8
If I change line 7 to:
Then it logs me in and works, so my assumption is that =strID" is the problem, but it works on the dumby page for reading the cookie. The only difference between these 2 pages is the &strID". So I put the & in on my page and error:Code:strSQL = "SELECT password, ID, username, admin, suspend FROM tblUsers WHERE ID =5"
Which is because there's nothing before the &, right?Code:Microsoft JET Database Engine error '80040e14' Syntax error (missing operator) in query expression 'ID = & strID'. /logintest.asp, line 8
It worked for awhile Friday and Monday, both times breaking after I tried to add something, so I took out the newly added code and it was still broke.
I don't know if this means anything but yesterday, I deleted the cookie and tried to recreate a new one (by logging in), I logged in fine but recieved no persistant cookie (had a session cookie though). Confused I repeated this for 20 minutes, then walked away. Came back closed everything, checked and there was no cookie from me, logged back in and it gave me a cookie....Ok no code changes, why didn't it create a cookie for those 20 minutes?
Is the problem in my code, or on the host?
Any help would be greatly appreciated, if anything is unclear on this, I appologize, if for some reason I left something important out, just slap me around a bit. Thanks for any help and for taking your time to read this.




Bookmarks