Categories
Engineering Spotlight

Improving the session table

One question I get asked from time to time is “Why does CoCart have it’s own session handler / database table?”

The reason for this is the default session handler is not designed to support guest customers outside of the site. It’s designed for the purpose of handling session requests with your browser.

Although guest customers were given a unique generated ID, this could only be tracked using the cookie WooCommerce stores on your device when browsing the store.

This does not help for a headless architect/setup when handling the cart outside of the site. So a new session handler was created in order to support guest customers for better tracking.

But why a new session table?

Well to begin with it was only experimental to test the new session handler but after sometime developing the new handler, I decided to keep it place for future developments.

This would allow me to alter the session table after without interfering with WooCommerce default session table structure.

This secures CoCart by making sure it still works should WooCommerce decide to change how their session table is structured in the future.

Now for the improvements

Although small, these additions I think are a great help to store managers and developers.

The new additions to the session table are “Cart Source” and “Cart Created“.

Now carts can be identified if they were created via CoCart or WooCommerce with the date and timestamp for when the cart was created the moment the first item was added to the cart.

I think this is a great addition and with that a new free add-on will be available that will allow you to view carts in session from your WordPress dashboard.

Screenshot is a work in progress.

This is something users have been asking for and it has defiantly helped me with testing CoCart during it’s development.

Hope you like the new additions and add-on coming soon.

%d bloggers like this: