471,612 Members | 2,506 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

newby C# web app cookie question

Hi:

I'm developing a web application that needs to have five values, each
retrieved from cookies on many pages.

If I have five "Request.Cookies" commands together does this cause five
"round trips" to the browser or am I accessing one instance.

If five round trips occur then I will develop some parsing algorithm to
save everything I need in one cookie.

Thanks for your help and suggestons!

Fred
Nov 30 '05 #1
4 1205
KJ
The cookies are transmitted in the "cookie header," so they are all
transmitted in each request.

Nov 30 '05 #2
KJ:

Thanks for your reply!

Does this mean that I should have five Request.Cookies commands in a row

ex:

Request.Cookies["value1"].Value.ToString();
Request.Cookies["value2"].Value.ToString();
Request.Cookies["value3"].Value.ToString();

and not suffer a penalty

Or is there a way to perform only one request and retrive all cookies at
once?

Thanks again for your help with this "newby" question!

Fred


KJ wrote:
The cookies are transmitted in the "cookie header," so they are all
transmitted in each request.

Nov 30 '05 #3
KJ
Hi, there is no penalty for accessing the Cookies object. It is already
populated when you are in the context of server-side code. Remember
that the "user agent" (a.k.a. Internet Explorer) makes the request, not
the server-side code. The server code runs in response to that request.

Nov 30 '05 #4
KJ:

Thanks VERY much for your help!

Fred

KJ wrote:
Hi, there is no penalty for accessing the Cookies object. It is already
populated when you are in the context of server-side code. Remember
that the "user agent" (a.k.a. Internet Explorer) makes the request, not
the server-side code. The server code runs in response to that request.


Dec 1 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Damien | last post: by
6 posts views Thread by Ajay | last post: by
reply views Thread by Pete | last post: by
1 post views Thread by Display Name | last post: by
10 posts views Thread by Fred Nelson | last post: by
15 posts views Thread by Oleg Leikin | last post: by
2 posts views Thread by Fred Nelson | last post: by
3 posts views Thread by Dan | last post: by
16 posts views Thread by Stevo | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

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.