Why does paypal set 50 cookies on my computer just to log in?

Do professional websites generally need to set 50+ cookies on a user’s computer in order for their website to function properly? Is this pervasiveness of cookie setting an industry standard? Any idea why Paypal feels the need to set so many cookies on my computer? And their stats cookie expires in 20 years? And an Apache cookie gets a 30 year expiration?

50+? I just cleared my cookies, logged in to PayPal, and it wrote 23 cookies. Still, that’s a lot.

As far as why do websites set cookies, it’s mostly to track things like personal preferences. Like, if you want to see 10 items per page versus 50, or what language you want to see the page in.

Some cookies - mostly those ones that look like gobblydegook - are used to identify you to the website as you do things online. For example, if you start adding things to a shopping cart, a website might write a cookie that tracks a shopping cart #, so when you add something else to your cart it knows to add it to cart #5234 and not cart #6034 which might be assigned to someone across the country.

As far as expiration, the program that writes the cookie decides when it’s going to expire. Some things, like the cart # I mention above, make sense to expire really fast. Other things, like what language to display the web site in, probably won’t change very often so they may decide that cookie expires in 30 years unless you change or delete it.

Why do some places store a lot of cookies? They probably feel like they want to track a lot of info. The more complex a website is, the more cookies it might use. Most of the time, they’re tiny and they don’t cause problems, so no need to worry about them.

Web developer checking in. 50 cookies are not required due to any theoretical technical limitation on web application development. In most of the applications I’ve worked on, we put a single cookie on the user’s browser that acted as a session key. That key would be used to look up any information we wanted to on the user, such as username, legal name, phone number, current active account, contents of shopping cart, and favorite color, which would all be stored on a server on our end.

It’s possible that multiple cookies could be required based on the specific design selected by PayPal developers, but it’s because that design was chosen, not because it would have been impossible to do it with fewer cookies.