Give Request.Cookies and Response.Cookies is there any reason to use another method to use cookies?

  • Thread starter Thread starter _Who
  • Start date Start date
W

_Who

Given Request.Cookies and Response.Cookies in asp.net is there any reason to
ever use javascript or any other method to use cookies?



Thanks
 
There is much JavaScript cookie code on the Internet and in books, that
shows how to write, read, and take apart what is read.
I have some saved. I was wondering if there is any reason for me to save
that.

Also, I work alone so it would be valuable to hear that using
Request.Cookies and Response.Cookies is a good approach not withstanding all
the code that uses document.cookie.

It's confusing. For example your statement: "For example if you have to set
them client side... "
Is there some reason to do that?

In fact, I'm looking at a 75-line code that is used to display the number of
visits by the person to the site. It uses document.cookie and JavaScript. Is
that the way you'd do it?

Thanks for helping
 
The answer your last question is yes.

But I find mostly cookie code on the internet uses JavaScript and from your
reply I now know that with ASP.NET that is not the way to go. For that I
thank you.
 
_Who said:
The answer your last question is yes.

But I find mostly cookie code on the internet uses JavaScript and from
your reply I now know that with ASP.NET that is not the way to go. For
that I thank you.

I'm not sure what its you are seeing. It is possible for cookies to be used
by both client and server. You use Javascript clientside to read and set
cookie info, you use Response.Cookies to read cookies server side and
Resquest.Cookies to set them. Personally I rarely do the clientside thing
its usually server side.
 
Debugging once I noticed that the session end event was not raised.

Thanks for the info below.
 
Back
Top