By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,606 Members | 2,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,606 IT Pros & Developers. It's quick & easy.

file not rendered because too many cookies

P: n/a
Hi,

Not sure it's a asp.net problem, but i discovered it with asp.net, so ...

I need to pass data from page to another, so i use cookies for that. My
problem is that when a certain amount of cookies are created, the browser
doesn't render the page anymore. The threshold i found (with trial and
error) is this: 48 times 5 cookies.
If i put 49 instead of 48, the page is not rendered (error= "the page cannot
be rendered"), otherwise, below 49, it works.

Any explanation for that, and possibly a solution?
Thanks
André.

dim i as integer
Dim cokval As new HttpCookie("cok")
Dim cok1 As New HttpCookie("cok1")
Dim cok2 As New HttpCookie("cok2")
Dim cok3 As New HttpCookie("cok3")
Dim cok4 As New HttpCookie("cok4")
Dim cok5 As New HttpCookie("cok5")
for i=1 to 48
cok1.Value = 10
Response.Cookies.Add(cok1)
cok2.Value = 8
Response.Cookies.Add(cok2)
cok3.Value = 12
Response.Cookies.Add(cok3)
cok4.Value = 5
Response.Cookies.Add(cok4)
cok5.Value = 6
Response.Cookies.Add(cok5)
next
Nov 30 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hey Andre,

You don't need to use cookies to pass data from one page to another.
For one thing the performance will suffer because cookies involve IO
operations (writing it and then reading it again)

Try and use the QueryString instead:

From page 1

Response.Redirect(string.Format("Page2.aspx?Item0= {0}&Item1={1},Item2={2}",10,8,12));

From Page 2

string Item0 = Request.QueryString["Item0"];
string Item1 = Request.QueryString["Item1"];
string Item2 = Request.QueryString["Item2"];

On Thu, 30 Nov 2006 18:29:42 +0100, "André" <hjhhb@ddwrote:
>Hi,

Not sure it's a asp.net problem, but i discovered it with asp.net, so ...

I need to pass data from page to another, so i use cookies for that. My
problem is that when a certain amount of cookies are created, the browser
doesn't render the page anymore. The threshold i found (with trial and
error) is this: 48 times 5 cookies.
If i put 49 instead of 48, the page is not rendered (error= "the page cannot
be rendered"), otherwise, below 49, it works.

Any explanation for that, and possibly a solution?
Thanks
André.

dim i as integer
Dim cokval As new HttpCookie("cok")
Dim cok1 As New HttpCookie("cok1")
Dim cok2 As New HttpCookie("cok2")
Dim cok3 As New HttpCookie("cok3")
Dim cok4 As New HttpCookie("cok4")
Dim cok5 As New HttpCookie("cok5")
for i=1 to 48
cok1.Value = 10
Response.Cookies.Add(cok1)
cok2.Value = 8
Response.Cookies.Add(cok2)
cok3.Value = 12
Response.Cookies.Add(cok3)
cok4.Value = 5
Response.Cookies.Add(cok4)
cok5.Value = 6
Response.Cookies.Add(cok5)
next
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 30 '06 #2

P: n/a
Thanks, i will try/
But did you heard about that cookie limitation?

"Rad [Visual C# MVP]" <no****@nospam.comschreef in bericht
news:vf********************************@4ax.com...
Hey Andre,

You don't need to use cookies to pass data from one page to another.
For one thing the performance will suffer because cookies involve IO
operations (writing it and then reading it again)

Try and use the QueryString instead:

From page 1

Response.Redirect(string.Format("Page2.aspx?Item0= {0}&Item1={1},Item2={2}",10,8,12));

From Page 2

string Item0 = Request.QueryString["Item0"];
string Item1 = Request.QueryString["Item1"];
string Item2 = Request.QueryString["Item2"];

On Thu, 30 Nov 2006 18:29:42 +0100, "André" <hjhhb@ddwrote:
>>Hi,

Not sure it's a asp.net problem, but i discovered it with asp.net, so ...

I need to pass data from page to another, so i use cookies for that. My
problem is that when a certain amount of cookies are created, the browser
doesn't render the page anymore. The threshold i found (with trial and
error) is this: 48 times 5 cookies.
If i put 49 instead of 48, the page is not rendered (error= "the page
cannot
be rendered"), otherwise, below 49, it works.

Any explanation for that, and possibly a solution?
Thanks
André.

dim i as integer
Dim cokval As new HttpCookie("cok")
Dim cok1 As New HttpCookie("cok1")
Dim cok2 As New HttpCookie("cok2")
Dim cok3 As New HttpCookie("cok3")
Dim cok4 As New HttpCookie("cok4")
Dim cok5 As New HttpCookie("cok5")
for i=1 to 48
cok1.Value = 10
Response.Cookies.Add(cok1)
cok2.Value = 8
Response.Cookies.Add(cok2)
cok3.Value = 12
Response.Cookies.Add(cok3)
cok4.Value = 5
Response.Cookies.Add(cok4)
cok5.Value = 6
Response.Cookies.Add(cok5)
next
--

Bits.Bytes.
http://bytes.thinkersroom.com

Nov 30 '06 #3

P: n/a
"André" <hjhhb@ddwrote in message
news:OH*************@TK2MSFTNGP02.phx.gbl...
I need to pass data from page to another, so i use cookies for that.
??? Why?
Nov 30 '06 #4

P: n/a
Yes, there are limits... Think about it. Should a server be allowed to
set a 1GB cookie on your hard disk?

Read this link for some details:
http://blogs.msdn.com/wndp/archive/2...0_cookies.aspx

On Thu, 30 Nov 2006 19:41:45 +0100, "André" <hjhhb@ddwrote:
>Thanks, i will try/
But did you heard about that cookie limitation?

"Rad [Visual C# MVP]" <no****@nospam.comschreef in bericht
news:vf********************************@4ax.com.. .
>Hey Andre,

You don't need to use cookies to pass data from one page to another.
For one thing the performance will suffer because cookies involve IO
operations (writing it and then reading it again)

Try and use the QueryString instead:

From page 1

Response.Redirect(string.Format("Page2.aspx?Item0 ={0}&Item1={1},Item2={2}",10,8,12));

From Page 2

string Item0 = Request.QueryString["Item0"];
string Item1 = Request.QueryString["Item1"];
string Item2 = Request.QueryString["Item2"];

On Thu, 30 Nov 2006 18:29:42 +0100, "André" <hjhhb@ddwrote:
>>>Hi,

Not sure it's a asp.net problem, but i discovered it with asp.net, so ...

I need to pass data from page to another, so i use cookies for that. My
problem is that when a certain amount of cookies are created, the browser
doesn't render the page anymore. The threshold i found (with trial and
error) is this: 48 times 5 cookies.
If i put 49 instead of 48, the page is not rendered (error= "the page
cannot
be rendered"), otherwise, below 49, it works.

Any explanation for that, and possibly a solution?
Thanks
André.

dim i as integer
Dim cokval As new HttpCookie("cok")
Dim cok1 As New HttpCookie("cok1")
Dim cok2 As New HttpCookie("cok2")
Dim cok3 As New HttpCookie("cok3")
Dim cok4 As New HttpCookie("cok4")
Dim cok5 As New HttpCookie("cok5")
for i=1 to 48
cok1.Value = 10
Response.Cookies.Add(cok1)
cok2.Value = 8
Response.Cookies.Add(cok2)
cok3.Value = 12
Response.Cookies.Add(cok3)
cok4.Value = 5
Response.Cookies.Add(cok4)
cok5.Value = 6
Response.Cookies.Add(cok5)
next
--

Bits.Bytes.
http://bytes.thinkersroom.com
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 30 '06 #5

P: n/a
It would definitely be limited by the allowed header size for a
request. Look into MaxRequestBytes for IIS. There's also an upper limit
to querystring size, is there any reason you're not using session
state?
André wrote:
Thanks, i will try/
But did you heard about that cookie limitation?

"Rad [Visual C# MVP]" <no****@nospam.comschreef in bericht
news:vf********************************@4ax.com...
Hey Andre,

You don't need to use cookies to pass data from one page to another.
For one thing the performance will suffer because cookies involve IO
operations (writing it and then reading it again)

Try and use the QueryString instead:

From page 1

Response.Redirect(string.Format("Page2.aspx?Item0= {0}&Item1={1},Item2={2}",10,8,12));

From Page 2

string Item0 = Request.QueryString["Item0"];
string Item1 = Request.QueryString["Item1"];
string Item2 = Request.QueryString["Item2"];

On Thu, 30 Nov 2006 18:29:42 +0100, "André" <hjhhb@ddwrote:
>Hi,

Not sure it's a asp.net problem, but i discovered it with asp.net, so ....

I need to pass data from page to another, so i use cookies for that. My
problem is that when a certain amount of cookies are created, the browser
doesn't render the page anymore. The threshold i found (with trial and
error) is this: 48 times 5 cookies.
If i put 49 instead of 48, the page is not rendered (error= "the page
cannot
be rendered"), otherwise, below 49, it works.

Any explanation for that, and possibly a solution?
Thanks
André.

dim i as integer
Dim cokval As new HttpCookie("cok")
Dim cok1 As New HttpCookie("cok1")
Dim cok2 As New HttpCookie("cok2")
Dim cok3 As New HttpCookie("cok3")
Dim cok4 As New HttpCookie("cok4")
Dim cok5 As New HttpCookie("cok5")
for i=1 to 48
cok1.Value = 10
Response.Cookies.Add(cok1)
cok2.Value = 8
Response.Cookies.Add(cok2)
cok3.Value = 12
Response.Cookies.Add(cok3)
cok4.Value = 5
Response.Cookies.Add(cok4)
cok5.Value = 6
Response.Cookies.Add(cok5)
next
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 30 '06 #6

P: n/a
Thanks all

"Mark Rae" <ma**@markNOSPAMrae.comschreef in bericht
news:uU**************@TK2MSFTNGP03.phx.gbl...
"André" <hjhhb@ddwrote in message
news:OH*************@TK2MSFTNGP02.phx.gbl...
>I need to pass data from page to another, so i use cookies for that.

??? Why?

Nov 30 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.