HTTP 1.1/400 Bad Request

D

Drew

I have been trying to figure out why I am getting this message... I have an
application that is 20 different ASP pages that works in sequential order
(step1, step2, step3...). After each step the app writes the entered text
to a cookie. This feature is so that if there is a problem, we can still
retrieve the data.

This Bad Request error has something to do with the cookie that is written
to, because I can go all the way through the app to the last step (step20)
and then it gives me a Bad Request. If I clear my cookies then it works
fine, until step 20 again.

Does anyone know what may be going on here? I am guessing that it has to do
with the size of the cookie, but I am unsure how I can accomplish this task
(allowing the entered data to be retrieved) without cookies.

Thanks,
Drew
 
M

Mark Schupp

How much data is being put in the cookies? I have heard of browser limits on
the size but not server-side limits.

Could you use hidden form fields instead?
 
D

Drew

The cookie I have on my computer (same error for me) is 13.2KB...

There is a great deal of data going in there... What about using the FSO to
write to a file? Does FSO have the ability to write to a file on the client
computer?

Thanks,
Drew
 
M

Mark Schupp

Does the data have to persist past the last step (page 20)?

If not, have each page include the data from the previous pages in hidden
form fields. If so, a server-side database would be an option (just keep the
user id in the cookie).

Server-side script cannot write files to the client's system. You could use
a component on the client-side to do so but that would require the user to
grant permission.
 
D

Drew

I am actually inserting this data into a SQL Server database, but I wanted
to implement a "safety net", in case someone has some problems, then we can
cut and paste the data back into the app.

My cookie code looks like this,

Dim AllText

If Request.Form("RelationshipsSocialization")<>"" Then
AllText = Request.Form("RelationshipsSocialization")
End If

If Request.Form("Communications")<>"" Then
AllText = AllText & Request.Form("Communications")
End If

Response.Cookies("ELPStep17")=AllText
Response.Cookies("ELPStep17").Expires= Now() + 10

The code fires on the page after the step, i.e. step17's data is put into a
cookie and inserted to the DB on step18.asp.

Is it possible to create more than 1 cookie from a domain? My cookies now
look like this,

dlaing@swvtc06[2].txt

Thanks,
Drew
 
M

Mark Schupp

I'm not familiar enough with cookies to help you much (the only cookie we
use is the session cookie).

Since you have a database available anyway why not keep the data in a table
in the database? Then just keep a record identifier in the cookie. Your
cookie retrieve/set code would turn into database select/update statements.
Clear the temporary data when the final update is done. Have a cleanup job
run occasionally to delete abandoned records.

--
Mark Schupp



Drew said:
I am actually inserting this data into a SQL Server database, but I wanted
to implement a "safety net", in case someone has some problems, then we can
cut and paste the data back into the app.

My cookie code looks like this,

Dim AllText

If Request.Form("RelationshipsSocialization")<>"" Then
AllText = Request.Form("RelationshipsSocialization")
End If

If Request.Form("Communications")<>"" Then
AllText = AllText & Request.Form("Communications")
End If

Response.Cookies("ELPStep17")=AllText
Response.Cookies("ELPStep17").Expires= Now() + 10

The code fires on the page after the step, i.e. step17's data is put into a
cookie and inserted to the DB on step18.asp.

Is it possible to create more than 1 cookie from a domain? My cookies now
look like this,

dlaing@swvtc06[2].txt

Thanks,
Drew
 
D

Drew

Yeah, I understand your suggestions... Thanks for your help, I am just going
to abandon the feature and forget about it!

Thanks,
Drew

Mark Schupp said:
I'm not familiar enough with cookies to help you much (the only cookie we
use is the session cookie).

Since you have a database available anyway why not keep the data in a
table
in the database? Then just keep a record identifier in the cookie. Your
cookie retrieve/set code would turn into database select/update
statements.
Clear the temporary data when the final update is done. Have a cleanup job
run occasionally to delete abandoned records.

--
Mark Schupp



Drew said:
I am actually inserting this data into a SQL Server database, but I
wanted
to implement a "safety net", in case someone has some problems, then we can
cut and paste the data back into the app.

My cookie code looks like this,

Dim AllText

If Request.Form("RelationshipsSocialization")<>"" Then
AllText = Request.Form("RelationshipsSocialization")
End If

If Request.Form("Communications")<>"" Then
AllText = AllText & Request.Form("Communications")
End If

Response.Cookies("ELPStep17")=AllText
Response.Cookies("ELPStep17").Expires= Now() + 10

The code fires on the page after the step, i.e. step17's data is put into a
cookie and inserted to the DB on step18.asp.

Is it possible to create more than 1 cookie from a domain? My cookies
now
look like this,

dlaing@swvtc06[2].txt

Thanks,
Drew

Mark Schupp said:
Does the data have to persist past the last step (page 20)?

If not, have each page include the data from the previous pages in hidden
form fields. If so, a server-side database would be an option (just
keep
the user id in the cookie).

Server-side script cannot write files to the client's system. You could
use a component on the client-side to do so but that would require the
user to grant permission.

--
--Mark Schupp


The cookie I have on my computer (same error for me) is 13.2KB...

There is a great deal of data going in there... What about using the FSO
to write to a file? Does FSO have the ability to write to a file on the
client computer?

Thanks,
Drew


How much data is being put in the cookies? I have heard of browser
limits on the size but not server-side limits.

Could you use hidden form fields instead?

--
--Mark Schupp


I have been trying to figure out why I am getting this message... I have
an application that is 20 different ASP pages that works in
sequential
order (step1, step2, step3...). After each step the app writes the
entered text to a cookie. This feature is so that if there is a
problem, we can still retrieve the data.

This Bad Request error has something to do with the cookie that is
written to, because I can go all the way through the app to the last
step (step20) and then it gives me a Bad Request. If I clear my
cookies then it works fine, until step 20 again.

Does anyone know what may be going on here? I am guessing that it has
to do with the size of the cookie, but I am unsure how I can accomplish
this task (allowing the entered data to be retrieved) without cookies.

Thanks,
Drew
 

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,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top