What are the potential pitfalls of using cookies to store large strings in PHP?

Storing large strings in cookies can lead to performance issues as cookies are limited in size and can slow down the website. To solve this issue, it is recommended to store large strings in server-side sessions or databases and only store a reference to the data in the cookie.

// Storing large string in session
session_start();
$_SESSION['large_string'] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";