Forums / Install & configuration / A strange effect with user login

A strange effect with user login

Author Message

Volker Lenz

Monday 03 March 2003 5:00:28 am

With ezp3-rc2 I observe a strange effect which I had not faced before. I could not trace the source of this, so I like to post it here in the hope for some hint:

When logging in to a non-public site with RequireUserLogin-flag set, it sometimes (I still do not know under which circumstances) happens that a user's first attempt to login with VALID (!!) credentials for the site results in a shadow-login to the PUBLIC site. However, the user receives another login screen without any warning or so for the non-public site he wants to access. If he enters his credentials again, he gets in as expected.

I found that the effect occurs when ezp runs php-sessions.

Any ideas ?

Volker Lenz

Tuesday 04 March 2003 2:55:36 am

> With ezp3-rc2 I observe a strange effect which I had not
> faced before. I could not trace the source of this, so I
> like to post it here in the hope for some hint:
>
> When logging in to a non-public site with
> RequireUserLogin-flag set, it sometimes (I still do not know
> under which circumstances) happens that a user's first
> attempt to login with VALID (!!) credentials for the site
> results in a shadow-login to the PUBLIC site. However, the
> user receives another login screen without any warning or so
> for the non-public site he wants to access. If he enters his
> credentials again, he gets in as expected.
>
> I found that the effect occurs when ezp runs php-sessions.
>
>
> Any ideas ?

Additional findings:

Effect occurs once each time you close & reopen your webbrowser.

As far as I see, the effect of a "shadow login" is somehow related to php session management. I have cookie-less sessions enabled in my php.ini. Thus, ezp sessions won't place session cookies and anonymous users are confronted with session-id's added to template hrefs on the first page request in a new browser window.

However, after the first page reload in a -- NEW -- browser window, the PHPSESSID dissapears from uri-requests and I wonder where it goes ??!!

Once the PHPSESSID has gone, the shadow login problem vanishes, too. Any clue ?

Volker Lenz

Thursday 06 March 2003 1:18:10 am

> > With ezp3-rc2 I observe a strange effect which I had not
> > faced before. I could not trace the source of this, so I
> > like to post it here in the hope for some hint:
> >
> > When logging in to a non-public site with
> > RequireUserLogin-flag set, it sometimes (I still do not
> know
> > under which circumstances) happens that a user's first
> > attempt to login with VALID (!!) credentials for the
> site
> > results in a shadow-login to the PUBLIC site. However,
> the
> > user receives another login screen without any warning or
> so
> > for the non-public site he wants to access. If he enters
> his
> > credentials again, he gets in as expected.
> >
> > I found that the effect occurs when ezp runs
> php-sessions.
> >
> >
> > Any ideas ?
>
> Additional findings:
>
> Effect occurs once each time you close & reopen your
> webbrowser.
>
> As far as I see, the effect of a "shadow login" is somehow
> related to php session management. I have cookie-less
> sessions enabled in my php.ini. Thus, ezp sessions won't
> place session cookies and anonymous users are confronted
> with session-id's added to template hrefs on the first page
> request in a new browser window.
>
> However, after the first page reload in a -- NEW -- browser
> window, the PHPSESSID dissapears from uri-requests and I
> wonder where it goes ??!!
>
> Once the PHPSESSID has gone, the shadow login problem
> vanishes, too. Any clue ?

Ok, this one is clarified:

If you have more than one domain on your system, php session manager sets an individual session cookie for each of these domains unless you specify otherwise in php.ini.

Now, on the first page load, the cookie is set, but cannot be immediately used as session-id container yet. Therefore, php uses PHP-session ids appended to your html til the cookie value becomes available to track a session.

If you have a link from domain1 to domain2 in one of your templates and a user presses this link immediately after having requested the page, the link will inevitably carry the php-sessionid of domain 1.
If the link to domain2 with a phpsession-id of domain1 is a link that opens a login screen, the user who logs in will NOT be logged in to domain2, but to domain1 instead, since the users login session-id belongs to domain1.

This is unwelcome and can only be resolved if you declare your session cookie valid for ALL domains. However, in order to support login-policy-restrictions in such an environment, you need to set explicit user-login-siteaccess1, user-login-siteaccess2 policies. And, most of all, you will need a patched version of ezp's index.php-file, otherwise users with all-domain session cookies will be allowed to login to all daomains even if they are denied by siteaccess-rules.

Valentin Svelland

Tuesday 17 January 2006 4:01:13 am

I've got multiple site installations on one server and I am quite familiar with this bug. Could anyone give me a good step-by-step guide to eliminate this problem?

------------------------
I made eZ run on www.eigersund.kommune.no, bjerkreim.kommune.no, lund.kommune.no and sokndal.kommune.no. Municipalities should use open source!

eZ debug

Timing: Jan 18 2025 05:22:26
Script start
Timing: Jan 18 2025 05:22:26
Module start 'content'
Timing: Jan 18 2025 05:22:27
Module end 'content'
Timing: Jan 18 2025 05:22:27
Script end

Main resources:

Total runtime1.2360 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 587.8359180.8203
Module start 'content' 0.00821.0996 768.6563575.9766
Module end 'content' 1.10780.1281 1,344.6328340.7500
Script end 1.2359  1,685.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3207210.0002
Check MTime0.00150.1188210.0001
Mysql Total
Database connection0.00150.122010.0015
Mysqli_queries1.144992.63551970.0058
Looping result0.00200.16251950.0000
Template Total1.204097.420.6020
Template load0.00170.141620.0009
Template processing1.202297.271820.6011
Template load and register function0.00010.007910.0001
states
state_id_array0.00120.093510.0012
state_identifier_array0.00100.084020.0005
Override
Cache load0.00160.1285850.0000
Sytem overhead
Fetch class attribute can translate value0.00130.101130.0004
Fetch class attribute name0.00170.141060.0003
XML
Image XML parsing0.00360.287430.0012
class_abstraction
Instantiating content class attribute0.00000.001480.0000
General
dbfile0.00610.4930330.0002
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs