Sortable list saving the last state

Sortable list saving the last state

Hello

Im trying to create a sortable list but I need to save the last state of the list, I have been trying but didnt succeed.

here an example of my code


I hope any one could help me.

thanks in advance