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

newby C# web app cookie question

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
KJ
The cookies are transmitted in the "cookie header," so they are all
transmitted in each request.

Nov 30 '05 #2

P: n/a
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

P: n/a
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

P: n/a
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.