Im a little confused as to the best way to approach the dealings with sessions when checking out, logging in, and logging out, in some cases the session can be written into the config file which is included in every page to help follow the user, however in other cases cookies are used until the checkout process, then the session starts, now what i am wanting to do is implement user registration on eCommerce which allows users to login and complete checkout but also give the option to checkout as a guest, without the user being registered,
my question is, whats the best way to track users? as logging in starts the session and logging out destroys the session, so if a user logs out will all items in cart be empty resulting in the user failing to be able to checkout?
any help or input would be much appreciated.
thanks guys! :)