Post by sfsf99 » Sat Aug 18, 2018 9:24 am

Maybe it is a problem of my provider, but sometimes I have the problem to see values in session fields from another user (customer) in my session.

I understand that sessions are being reused but not emptied, I check this currently with my provider ..

For e.g. the field order comment you see this session field always cleared in account login and logout and checkout success. So this field is always cleared in a new session.

But you don't see this field being cleared in account register, checkout login and checkout guest. Is that a bug or what are the thoughts for clearing this only in account login and logout and checkout success ?

New member

Posts

Joined
Thu Jan 11, 2018 5:22 am

Post by MarketInSG » Sun Aug 19, 2018 11:00 pm

I've heard of this where some users with websites on shared servers ended up having their session jumping to a random user's session. It's usually a server issue, and you should consider moving to a better web host.


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by sfsf99 » Mon Aug 20, 2018 3:24 am

Test .. an whole answer and I have to relogin .. answer gone .. so copy your answer before submitting ..

Maybe, I have to find out what is happening. The problem is with only a new session checkout field like the checkout comment field.

And I see that this kind of fields are always initialized in a new session e.g. in account login, account logout and checkout success (I forgot to initialize my new field in login). So maybe this is done for a reason. Suddenly I see now that reason .. suppose you have entered checkout as a guest and you filled the checkout comment field and you decide to login, then all checkout session fields must be cleared again ..

Is this a reason or are there more reasons ?

So probably have been supposed that the whole session is empty when starting a new session ... and for a reason as above, some session fields must be cleared ..

New member

Posts

Joined
Thu Jan 11, 2018 5:22 am

Post by sfsf99 » Tue Aug 21, 2018 12:27 am

Sorry, finally found.

It was a situation when as well admin as webstore open in a browser session (same session) and in a specific sequence, using the same session field.

Webstore and admin have the same session, also called Ajax programs. But programs called by curl (api's for admin order entry) have another session, so session fields admin order can't be mixed with an entered order in the webshop. So if you need a new session field in the admin order entry, use that field in the api's called with curl. Use other session fields for the order entry outside the api's in the normal admin session. Now I understand what was going wrong in my programs.

But what I said about why session fields are cleared only in 3 programs, is right I think. So a session is always empty when started.

Meanwhile also another important error fixed for my customer that the time was not right in OpenCart, no problem on the server. Because of the instruction in system/startup.php : if (!ini_get('date.timezone')) { date_default_timezone_set('UTC');}
So the PHP server time is right, but ini_get('date.timezone') = 0 (when date.timezone not set in php.ini), normally you don't find this error easily but with some payments the time was specified in a comments field and the date around midnight was wrong. I write here about the PHP date (instruction Date), the date in mysql was right (instruction now()).

New member

Posts

Joined
Thu Jan 11, 2018 5:22 am
Who is online

Users browsing this forum: No registered users and 248 guests