Forums / Developer / fetch user problem with session confusion

fetch user problem with session confusion

Author Message

Samuel Sauder

Friday 09 June 2006 12:43:06 pm

If I login as user1 then login as user2. The login/logout verbiage from the toolbar says I am now user2. But in the body of the page it identifies me as user1.

In the body template, I have this code:

{def $user=fetch( 'user', 'current_user' )}
User:     {$user.contentobject.name} <br />

If I clear the cache, then the body shows the correct user2.

It appears the session is always pulling from the previous logged in user rather than "current". It also appears that current_user in pagelayout is always correct.

Is this a bug?

version: 3.7.2 on mysql

Kristof Coomans

Saturday 10 June 2006 12:02:36 am

Hi Samuel

Do you experience the same behavior in the latest release of the 3.7 branch?

What do you mean with the body template? And which caches do you have to clear to make it work?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Marcin Drozd

Saturday 10 June 2006 4:06:17 am

Hi
I had the same problem (ez 3.7.6)
but I put {set-block scope=root variable=cache_ttl}0{/set-block} in my template and it was good

http://ez-publish.pl

Samuel Sauder

Monday 12 June 2006 9:40:17 am

Thanks, that was it!

Samuel Sauder

Monday 12 June 2006 9:43:22 am

I'm guessing this is the bug
http://ez.no/community/bugs/cache_block_with_expiry_0_always_expires_when_templatecompiling_is_disabled