I have recently started programming in PHP.
I am building a cart in PHP. I have my products locked in cart when someone adds it to their cart.
I need to unlock those products when the specific user gets logoff or session expires.
How can i call something like session_onend function as in asp/asp.net to unlock/release those locked products?
Why not consume the product from stock when the order is actually placed. Hold the product until the user fills out the correct info for billing, then reduce inventory when all goes correctly?