If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / Recreate Session - how does cart know what the new session id is?

Recreate Session - how does cart know what the new session id is?

Started by dogtags on 13 Jan 2012, 6:13 PM · Views: 1,249

Results 1 to 4 of 4
13 Jan 2012, 6:13 PM
#1
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Recreate Session - how does cart know what the new session id is?

ZC 139h

If recreate_session is triggered, how does the cart know what the new session id is and how to associate it with the old session id?

In other words, what is the code "bridge" built to the new session id?

Are there any flags or variables that are triggered that could be used in an external module to keep the shopping session straight?

Thanks :smile:

13 Jan 2012, 10:34 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Recreate Session - how does cart know what the new session id is?

It simply memorizes all the existing session contents, deletes the old session id, creates a new session id, and restores all the prior session variable contents to it. Nothing special.

If you're using an "external" service or addon that is memorizing session ids then it's probably founded on very poor logic.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Jan 2012, 6:31 PM
#3
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Re: Recreate Session - how does cart know what the new session id is?

Thanks Dr.

No, it just needs to know what the new session id is so it can keep everything straight

15 Jan 2012, 6:34 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Recreate Session - how does cart know what the new session id is?

Which module are you talking about? What exactly does it need to "keep straight"? Tying anything external to internal specific session id numbers is generally bad practice.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.