...

View Full Version : session problems



timgolding
11-21-2006, 02: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

isset($_SESSION['key'])

I need something more like

isset($_SESSION)

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

Thanks

timgolding
11-21-2006, 03:26 PM
This works :)



$session_data=false;
foreach($_SESSION as $current_item)
{
if (is_a($current_item, 'myclass'))
$session_data=true;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum