Undesired switching of user accounts

Author Message

Rikard Ahrgren

Thursday 08 January 2009 10:34:35 am

I'm not sure if this is the right place, so please bear with me.
I have a strange problem in which a user is logged in to another users account by simply accessing the same page as the another within a short period of time.

Consider the following scenario:
One user logs in and accesses a few pages and logs out. Then another user with exactly the same rights as the first user accesses the same page a couple of minutes later.
The second user will then have been switched to the first user's account, but not with the rights to edit the first user's personal information or objects. When the second user accesses another page which the first one haven't he is switched back to his original account, but as soon as he goes to a page the other user has accessed, he is logged back to that user.

Worth to mention is that it only works if the users are a member of the same groups. Two different user with different rights does not affect each other. It works no matter if it is from the same computer or two different, from different ip-addresses.

I cannot imagine this to be a general bug, but i have no idea why it does so on my site.. I'm quite new to ez publish. Please help me.

By the way, I'm using ez publish 3.9.0.

Kristof Coomans

Thursday 08 January 2009 10:50:10 pm

Hi Rikard

Does this concern pages that were cached by the content view caching system? See http://ez.no/developer/articles/ez_publish_performance_optimization_part_3_of_3_practical_cache_and_template_solutions/caching_overview. If you want to put user specific information into node views, then you need to disable content view caching.

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

André R.

Friday 09 January 2009 4:11:15 am

ezwebin on eZ Publish 3.9.0 had a issue where it caches pagelayout header (using cache block) pr users with same rights, and not pr user. So your not logged in as another user, it's just another users user name that shows up on the webpage( so no security issue besides seeing the name of another user an his user id in the markup).

You can update ezwebin to 1.2 to get the fix, but you'll need to update eZ Publish as the updated uses nested cach-block's witch didn't work on 3.9.0 (fixed in a later 3.9.x version so use latest 3.9.x version or newer).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Rikard Ahrgren

Friday 09 January 2009 4:35:47 am

Thank you very much for your help! Disabling templatecache in site.ini.append solved my problems

Regarding the issue in 3.9.0, it sounds exactly like the problem, but when I used
{def $current_user=fetch( 'user', 'current_user' ) } in a template file it also gave the wrong user. And if the user was trying to change personal settings while the wrong name was shown it stated that the apporiate rights was missing for that account.

André R.

Friday 09 January 2009 5:25:53 am

fetch current user issue, see Kristof's post.
No rights to edit: This is caused by the fact the user id is in the url, so if you get wrong name you also get wrong url.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:14:28
Script start
Timing: Jan 18 2025 22:14:28
Module start 'layout'
Timing: Jan 18 2025 22:14:28
Module start 'content'
Timing: Jan 18 2025 22:14:29
Module end 'content'
Timing: Jan 18 2025 22:14:29
Script end

Main resources:

Total runtime0.5903 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.0313152.6406
Module start 'layout' 0.00470.0029 740.671939.4766
Module start 'content' 0.00760.5811 780.1484604.3281
Module end 'content' 0.58870.0016 1,384.476616.1406
Script end 0.5903  1,400.6172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5206160.0002
Check MTime0.00120.2102160.0001
Mysql Total
Database connection0.00060.102510.0006
Mysqli_queries0.537791.0943650.0083
Looping result0.00070.1127630.0000
Template Total0.562595.320.2812
Template load0.00200.344420.0010
Template processing0.560494.937220.2802
Template load and register function0.00020.033210.0002
states
state_id_array0.00080.139110.0008
state_identifier_array0.00070.112720.0003
Override
Cache load0.00170.2833270.0001
Sytem overhead
Fetch class attribute can translate value0.00060.103030.0002
Fetch class attribute name0.00130.226270.0002
XML
Image XML parsing0.00120.196330.0004
class_abstraction
Instantiating content class attribute0.00000.002780.0000
General
dbfile0.00180.3100230.0001
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs