HI All,

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! :)

You really need to understand how http works under the hood for this kind of thing.

Its too much to cover in a textbox on a forum like this. You would be much better off spending some time watching some videos. This one for example is quite good:

https://www.youtube.com/watch?v=gav4HmZ8xe8

thanks daveamour, i do understand how cookies and sessions work however wanted to know of the best approach others would use for what i am trying to achieve, thanks for the link, its a good refresher.

Ok sorry my apologies.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.