Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP 2.0 Cookies and Windows2000 Professional

Status
Not open for further replies.

jazzsax

Programmer
Oct 18, 2002
13
0
0
US
Hi,

I did do a search to see if this had already been addressed, but couldn't find it.

I has set up some very basic cookie security on several asp apps I worked on. Everything was working fine, didn't make any changes to the code. However, recently, our agency changed to Windows2000 Professional and my cookies are not working the same way. Basically, all I wanted to do was for it to look for the cookie, and if it doesn't find what it's looking for, it response.redirects to a page they can enter their password. It used to work fine, now it doesn't matter whether there's a cookie or not, it allows access to the application. Has anyone else had this problem or can you offer any suggestions.

Code snippet:

<%

'verify cookie hasn't expired, if it has send them to login

userID = Request.Cookies(&quot;ConfUserID&quot;)

sqlStr = &quot;SELECT UID FROM ConfUsers WHERE UID = '&quot; & userID & &quot;'&quot;
SET RSV = connectStr.Execute(sqlStr)
if (RSV.EOF or RSV.BOF) THEN
response.redirect(&quot;passentry.htm&quot;)
end if

%>

Thanks,

Jason
Austin, Texas
 
Hey Jason, try this:

Code:
userID = Request.Cookies(&quot;ConfUserID&quot;)
>%
<textarea rows=&quot;10&quot; cols=&quot;80&quot;><%=userID%></textarea>

What do you see?

-pete
 
Pete,

Thanks for your response. Of course, prinit it to the screen. Well strangely tha pp I took the snippet from seems to be working now, but I continue to battle the other app that has the following code:

userID = Request.Cookies(&quot;CMSLoginID&quot;)

sqlStr = &quot;SELECT permit FROM email WHERE UID = '&quot; & userID & &quot;'&quot;
SET RS = connectStr.Execute(sqlStr)

strVal = RS(&quot;permit&quot;)
if RS.EOF THEN
response.redirect(&quot;UserError.htm&quot;)
end if

Both the userID and RS(&quot;permit&quot;) show no values, yet the page is not being redirected...

This worked fine for months, I never touched it and then it doesn't work...sometimes I think I must be more insane than I originally suspected.
 
Maybe because your requesting a value (strVal = RS(&quot;permit&quot;)
) from the recordset its running into an error and then stopping processing the rest of the page Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top