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

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
 
W

_Who

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
 
W

_Who

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.
 
A

Anthony Jones

_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.
 
W

_Who

Debugging once I noticed that the session end event was not raised.

Thanks for the info below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top