Groups | Blog | Home
all groups > inetserver asp general > april 2005 >

inetserver asp general : HTTP 1.1/400 Bad Request


Drew
4/27/2005 12:00:00 AM
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

Mark Schupp
4/27/2005 12:46:41 PM
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


[quoted text, click to view]

Mark Schupp
4/27/2005 2:35:17 PM
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


[quoted text, click to view]

Drew
4/27/2005 4:21:38 PM
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


[quoted text, click to view]

Drew
4/28/2005 12:00:00 AM
Yeah, I understand your suggestions... Thanks for your help, I am just going
to abandon the feature and forget about it!

Thanks,
Drew

[quoted text, click to view]

Drew
4/28/2005 8:31:52 AM
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

[quoted text, click to view]

Mark Schupp
4/28/2005 8:46:32 AM
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



[quoted text, click to view]

AddThis Social Bookmark Button