Unfinished Listings
The way it works is that a cookie containing a “session number” is created when the user logs in for the very first time. When the user revisits using the same PC and same browser, that same session number is retrieved from the cookie. Now, when a user starts a listing, that listing’s details are stored in the database against the user’s session number. When the user logs off using the sign off button, that record (of the unfinished listing) is deleted. However, if the user just closes the browser without formally logging off, the listing’s details remain. It is the retrieved whenever the user next logs in.
In short, the problem lies in users not logging off, but just closing the browser. The fix may be to delete any record with a matching session number when the user logs in. That might cause a new issue, though, in that if the user session times out while he or she is looking for a photo, for example, then the partially complete listing will be gone.
I have modified the classified_sell_class.php and index.php files so that when a interrupted listing is found, a JavaScript function is injected into the page. I added the referenced JavaScript function to hw_ua.js, which we previously “included” on each page. (Can’t remember what for! To display the Help panels, perhaps?)
Anyway, the JavaScript displays an alert box warning that it’s an interrupted listing. When the user OKs the alert box, the script sets a cookie so that the alert is not shown again for that browser session. In other words, when the browser is closed, the cookie is lost. That way, when the user next opens the browser and goes to add a new listing, the alert re-displays.