I am building a simple 4 step shopping cart sequence and I am passing data between pages using $_SESSION. If I go back and forth between pages using Form Submit buttons and method=POST, it works most of the time. But about 20% of the time I will completely lose my session navigating back and forth between pages. I also noticed that if I had a 'view cart' button with a GET href, I would lose my session data.
I fixed the problem by putting session data in hidden fields of each page, but I am not sure this is the best way to do it. Is there some page I can read up on that describes best practices for managing shopping cart session data? For this project, I am putting cake sessions in a db table. Here are some of my questions: - Why am I losing my $_SESSION variable occasionally? When does it get set in page processing? - I use $_SESSION because it looks like it should be so convenient. But is there a limit to the size of data/array you can put into a $_SESSION key? - When do you use $_SESSION and when do you use Cookies? Still not clear on this - Are their big security risks to be aware of when using $_SESSION vs hidden fields vs http GET params? - Also, I tried to share a session between 2 cake apps which share a common /cake folder. Couldn't get it to work. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
