Loading...
 
Skip to main content

Themes


PHP Session problem

Hi,

(If this is the wrong forum, please excuse me, couldn't find a better one).

Anyway, I have problem with using PHP Session variables.

Scenario:
Using Tiki 1.9
I have tried to make "Site Areas" in my tikiportal. The purpose is that when a user clicks a link, the menu in the left side changes, so that is shows articles under this site area. If another site area is choosen, then another list with articles appears. Also the header image should change with the site area. I use PHP sessions, to store wich site-area what choosen last, beacuse this should last until another site area is choosen.

I works alright, BUT 1 click to late. The menu is only updated after I click on something else or click twice.
The session variable is set after the specific site-area link is choosen (I use the bottom of tiki-setup.php, because it is always included). I then get the list of topics in the module, depending on the value of the site-area session variable. I suppose that the left-side modules are loaded after tiki-setup.php why it should be the new value of the site-area var, that I get hold of, right. I don't use cache in the module. When I set the session var in tiki-setup.php I also assign a corresponding smarty variable, but this cannot be accessed in the module. Something with scope of smarty variables, I guess. Can the scope be changed or is there a workaround.

I am not very experienced with PHP language, but normally figures it out. Is there something special with session vars. Where should I set variables (which file) if I want them to be accessible within the some page as they are
set on.

Thanks,