Here's a very good tutorial: http://nettuts.com/tutorials/javascript-ajax/inettuts/
You will need to save the user data in the mysql table. Perhaps customize the column / row column in your mysql table with the associated content id. If you do not have knowledge of relational databases, it would be nice to start there. If you understand the basics of db, then this will be a simple update request to store cookie information based on a cookie that is outdated in the future.
If you allow users to log in (e.g. google), the use of cookies is optional (but may be useful), since you can use the div position data stored in your mysql table.
source share