0

I want to saved input field data in browser cache using Codeigniter

<input type="search" name="location" class="icon glass" placeholder="Enter Your Location" required>

This is my input field when a user inputs something and revisit this page another day this field data will be saved on browsers cache. how to enable this using Codeigniter I tried with $this->output->cache($n); But didn't understand with this. Can anyone please clarify me about Codeigniter caching to saved input field data in the browser cache.

Shawn
  • 1,232
  • 1
  • 14
  • 44
  • What **exactly** are you looking for? CI is running on the server and can not put anything into the browser cache directly – Nico Haase Apr 07 '20 at 20:57
  • in the input field when the user inputs something it will store in browser cache i just want this. I fixed it already using javascript local storage Thanks @NicoHaase – Shawn Apr 08 '20 at 02:11

1 Answers1

0

A web cache (or HTTP cache) is an information technology for the temporary storage (caching) of web documents, such as HTML pages and images, to reduce bandwidth usage, server load, and perceived lag. Cache is just a collection of data downloaded to help display a web page.(source)

You can not retrive data from browser cache. What you need to use is cookies or sessions

You can find more about difference between cache and cookies here.

You can use Cookie Helper or Session Library to achieve you desired result.

Dum
  • 1,431
  • 2
  • 9
  • 23