473,414 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Problem with response.Cookie

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?
Jul 19 '05 #1
1 2090
=?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
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jaakko T Oksa | last post by:
The following script sets,resets or displays the contents of a cookie. When I place the script in a directory under the iis root, let's say "mysite" (http://localhost/mysite/tst.asp) it works as...
2
by: Ian | last post by:
I have a problem I hope someone can point out where I am going wrong. I need to store a date/time in a cookie ( ie the date a visitor last visited ) However the date format changes to US, despite...
1
by: Satinderpal Singh | last post by:
Hi everyone, We are using HttpWebRequest to create a request to a URI, which requires us to login first. In order to process all the transactions, first we have to login and get the cookie value...
22
by: Kristof Thys | last post by:
Hello, I'm developing a C# - windows forms application. To get some information for my application, I'm connecting to an URL, wich gives me XML generated using php. With 90% of the users, this...
1
by: Michal A. Valasek | last post by:
Hello, I have problem deleting cookies and cookies values (using framework version 1.1 on W2003). When I try to remove entire cookie, by calling Response.Cookies.Remove("Test"), nothing...
1
by: Satinderpal Singh | last post by:
Hi everyone, We are using HttpWebRequest to create a request to a URI, which requires us to login first. In order to process all the transactions, first we have to login and get the cookie value...
1
by: tshad | last post by:
I am trying to write out and update my cookies, but it doesn't seem to work correctly. I am using the following code: if (passwordSaveCookie.checked) then If Request.Cookies("User") is nothing...
1
by: .NET Developer | last post by:
I'm having an issue that hopefully someone here can help me out with. First a quick explanation: I'm managing users of my site in a fairly custom way. (in other words I'm not using asp.net's...
0
by: Rafal Zawadzki | last post by:
Hi. I tried earlier to write python zsi mail list, but nobody answered. I am using ZSI 1.7/2.0rc1 with TTPro Soap SDK. The wsdl file can be found here: http://demo.seapine.com/ttsoapcgi.wsdl ...
0
by: Alok yadav | last post by:
i am using the link of metacharge.com for payment gateway, when i post data throung IE it give the correct response, but when i use the .net code to post data the response is not correct.message is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.