Best approach in payment and sessions

I stored data in sessions, then i clear the session in a success url when the payment is successful. Is this the right approach? I’m thinking, what if the payment is successful then it does not return to the success url or the connection is interrupted? On my success url i did some codes to store it in a history database before clearing it.

Can you edit your initial post with the code you’re referencing, please? Be sure to enclose the code block in ``` before and after the code block is finished.

@clarkeustaquio

Please share how you approach this :slight_smile: