[pmwiki-devel] session_start problem

marc gmane at auxbuss.com
Tue Dec 5 12:45:48 CST 2006


marc said...
> 
> This is one of those "Doctor, it hurts when I do this.", "Well, don't do 
> it then" problems.
> 
> I have a site with a cart. The cart object is stored as a session 
> variable. It all works fine.
> 
> The site uses authuser with a recipe to check users against a MySQL db 
> (using ADOdb lite and the Database Standard). This also all works fine.
> 
> Someone can add items to the cart, login, and the cart data remains 
> intact.
> 
> Now, I've added a hook to function AuthUserDatabase(), so that I can 
> setup a user object and populate it as soon as the user is 
> authenticated. This object is also stored as a session variable.
> 
> So, once logged in, we have the usual PmWiki session variables, a cart 
> object session variable and a user object session variable. 
> 
> All that the login script does is:
> 
>   function LoggedIn ($userName) {
>     session_start();
>     $member =& $_SESSION['member'];
>     if(!is_object($member)) $member = new Member($userName);
>   }
> 
> The problem is that when session_start() is performed, the cart session 
> variable disappears, and with it the displayed cart. But, when I comment 
> out session_start(), everything behaves as normal.
> 
> I don't expect a solution, but does anyone have any ideas where the 
> problem might potentially lie? Thanks.

Hi,

The solution turned out to be to move the include for the cart recipe 
above the authuser recipe.

There is something funky happening with sessions with authuser and I'd 
appreciate it if someone could fill in the background.

-- 
Best,
Marc




More information about the pmwiki-devel mailing list