Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storage accessible by Javascript and Php?

Is there any storage like cookies that is accessible by JavaScript and PHP, I would use cookies, but their maximum capacity is too low, and I cant figure how to access HTML5 Local Storage by PHP.

like image 716
user3087101 Avatar asked Jul 30 '26 08:07

user3087101


1 Answers

No, there isn't.

You need to communicate back and forth between the browser and server via HTTP requests. There is no other way for them to share data. There are storage solutions like PouchDB that provide the illusion of shared client/server storage, but they're simply doing the HTTP request part for you.

Your data storage should be server-side. Your browser "stores" data by sending that data to the server via an HTTP request, and later retrieves that data the same way. This is how every virtually every website you've ever visited stores any substantial amount of data.

like image 77
meagar Avatar answered Aug 01 '26 22:08

meagar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!