Store the ids in an array in session in Codeigniter

You will probably need to use ajax
Give the like button a name and then in jquery make it on click event.

<button class="like">LIKE BUTTON</button>

$(document).ready(function(){

   $('.like').on('click',function(){

        YOUR AJAX CODE HERE 

   })

})

In controller
GET your ajax value and insert those into a session.
I know this code is not that something you are looking for but it’s just an idea.

Leave a Comment