View Full Version : session problems

11-21-2006, 03:58 PM
I am having a problem with some session data.

I need to test wether any session data has been set and if it hasn't then I need to display a message. Session data should only be set when a user adds an item to his order. This creates a session var where the key of this is the product key. Therfeor I can't use an


I need something more like


I tried this and found that even if no items were added to order the conditional statemnt would still return true. I have to use the start_session(); at the top of each page and wondered if this was casuing the problem.

If anyone had any explination of what the problem might be I would be very grateful

I wondered if it is possible to see if any session data is a member of my product class


11-21-2006, 04:26 PM
This works :)

foreach($_SESSION as $current_item)
if (is_a($current_item, 'myclass'))