NEED COOKIE ADVISE

I

in da club

I want to give a userid for each user and track it by userid. I need to
store it in a cookie . What method will be beneficial for that process ?
Using javascript or Server side scripting (asp.net) will be more effective ?
 
J

Jason Kester

For performance issue ;)

Ah, performance issue. Gotta squeeze that extra bit of performance
out of our cookie-setting routine and do it by hand. Good plan.

Look, Session uses Cookies. In fact, it sets a Cookie containing
something that you can essentially think of as a UserID. As in, it
does exactly what you're looking to do already. And it does it just
as fast as you could by hand, so your "performance" claim only makes
you look like you haven't done your homework.

Look into FormsAuthentication. Chances are it does exactly what
you're looking for.


Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 
I

in da club

http://www.developerfusion.co.uk/show/4318/2/


take a look

Since session variables are stored on the Web server's memory, storing large
objects in a user's session on a site with many simultaneous users can lead
to reduced memory on the Web server. For more information on session
variables see the Session Variables FAQs on ASPFAQs.com.


I can use javascript to write and read cookies without exhausting my server
resources ;)
 
M

Mark Rae

Since session variables are stored on the Web server's memory, storing
large objects in a user's session on a site with many simultaneous users
can lead to reduced memory on the Web server. For more information on
session variables see the Session Variables FAQs on ASPFAQs.com.

Cookies are tiny pieces of textual information, no use at all for "storing
large objects", so your comparison is meaningless.
I can use javascript to write and read cookies without exhausting my
server resources ;)

What about the (increasing number of) people who disable cookies and/or
JavaScript...?
 
I

in da club

ok you are right about disabling javascript cookies. My purpose is that find
out pros and cons using javascript or server side cookies .. Thank you for
your reply. I decide to use cookies in server side scripting..
 
M

Mark Rae

server side cookies

There's no such thing as "server-side cookies" - a cookie is a small text
file which resides on a client machine, not the server...

Cookie support in browsers can be turned off, and cookies can be deleted...
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top