Thanu
Thanu

Reputation: 2501

Magento : How to track or best way of tracking a customer session?

Currently I'm working on a Magento module that allows customers to upload files against their order at the product page.

So what I thought was to have the files saved in a folder created with the session id as the folder name, until they submit their order. But then I ran in to an issue with this solution, which is, when a customer uploads a file as a guest and if they logged in after, or if they create a new account, the session ID get change, and no way of back tracking previous session data or id.

I looked at visitor ID and that doesn't work either. coz for a new customers/visitors don't have a visitor id, so thats out too.

Any suggestion?

Upvotes: 1

Views: 1536

Answers (2)

Francis Kim
Francis Kim

Reputation: 4285

You can track such instances with a cookie & the right expiry time. The following documentation helped me out a lot when working with cookies:

http://www.quirksmode.org/js/cookies.html

Upvotes: 1

muhammedv
muhammedv

Reputation: 879

Visitor ID doesn't change after login. It changes after logout, which is perfectly normal. Also, all visitors have visitor ID, whether they new or not or logged in or not.

Upvotes: 0

Related Questions