i m adding an book detail in a page(book_detail.php), when i add book information ,i m also adding offers and addons via iframe( using lightwindow.js) related with that book and i saved their id;s in 2 session array. if someone add 2 addons and 3 offers related to that books, i store those addons_is and offer_id in session and when i fill the all detail regarding that book,on the same time i add addons_is and offer_id in the database in same row. like
book_id|book_name|book_price|book_addons|book_offers|
1 | php | 100 |10,11, | 17,18,19
where 10,11 from table_addon where that addon detail is saved and 17,18,19 is from table_offers where offer details are saved
now my question is: if someone add 2 offers and 3 addons with their detail, and does not go to submit that page( means he does not add details of that book) and go back, then how do i delete that addons and offers from both of tables.means i want to reset session array as well as the entry from both of table , if someone comes again to add new book detail.
i can not reset session when use comes first time , because on adding addons via iframe , page refresh automatically, so it is not possible to reset session on page load