Problem with response.Cookie

K

kbrad

I am trying to add some basic security to my asp web pages.
I have a logon screen which, when the logon and password are checked for
validity, passes the user on to a registration screen using the code
response.Redirect "user_reg.asp?User=" & Request.Form("UserName")

I then inserted the following line before the redirect
response.Cookies("ValidUser") = "ValidUser"

I have the following check at the start of the user_reg.asp page
<%
if request.Cookies("ValidUser") <> "VaildUser" then
response.redirect "user_login.asp"
End if
%>

All that happens now is that when I log in validly user_login.asp is
redisplayed rather than the user_reg.asp.

Perhaps this is not sufficient to set the cookie? I have looked for it but
can't see it amoungst other cookies dated today.

Can anyone advise?
 
E

Evertjan.

=?Utf-8?B?a2JyYWQ=?= wrote on 02 okt 2004 in
microsoft.public.inetserver.asp.general:
I am trying to add some basic security to my asp web pages.
I have a logon screen which, when the logon and password are checked
for validity, passes the user on to a registration screen using the
code response.Redirect "user_reg.asp?User=" & Request.Form("UserName")

I then inserted the following line before the redirect
response.Cookies("ValidUser") = "ValidUser"

I have the following check at the start of the user_reg.asp page
<%
if request.Cookies("ValidUser") <> "VaildUser" then
response.redirect "user_login.asp"
End if
%>

All that happens now is that when I log in validly user_login.asp is
redisplayed rather than the user_reg.asp.

Perhaps this is not sufficient to set the cookie? I have looked for it
but can't see it amoungst other cookies dated today.

Can anyone advise?

"VaildUser" <> "ValidUser" but failed user

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

Use session variables.

if session("ValidUser") <> "ValidUser" then
response.redirect "user_login.asp"
End if


And in user_login.asp:

..........
if ok then
session("ValidUser") = "ValidUser"
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top