Single login through different SiteAccess (using sub-domains)

Author Message

Hakim Bouras

Sunday 09 May 2010 8:14:40 am

Hi,

I am using 3 SiteAccess for a multilingual site (ez 4.3) - with a "Host" access:

  • eng.mysite.com
  • fr.mysite.com
  • admin.mysite.com

I would like to be able to log on "eng.mysite.com" and go to "fr.mysite.com" without having to log again.

I have set in site.ini :

[Session]
SessionNameHandler=default
SessionNamePerSiteAccess=disabled

But it does not work, the cookies set by the application still have a cookie_domain set to "eng.mysite.com" - and I have to log on each siteaccess.

Any idea, if it is possible to do and if so how ?

Thanks,
Hakim

In my php.ini, I have default settings such as:

  • session.cookie_path = /
  • session.cookie_domain =

Hakim Bouras

Friday 14 May 2010 6:35:45 am

Hi,

Based on the doc written in site.ini (see below), I was expecting that it is possible to go through different site access with the same login by setting the SessionNameHandler to "default". But it does not work for me.

Any help to find out :

  1. if it is feasable
  2. what are the correct settings to use

will be greatly appreciated.

Thanks,
Hakim

Extract from site.ini (eZ PUblish 4.3)

# Decides how the name of the session value is handled.
# Possible values are:
# default - Let PHP decide the session name, this also rules
# out the possiblity for per-siteaccess sessions.
# custom - Use SessionNamePrefix for name. per-siteaccess sessions are possible.
SessionNameHandler=default

# Whether the session name should be unique per siteaccess.
# By enabling this you will be able to get one unique login per siteaccess.
# Session name is md5 encoded to avoid issues with non alphanumeric characters.
# Note: Will only work if SessionNameHandler is set to custom
SessionNamePerSiteAccess=enabled

Yannick Olympio

Thursday 09 September 2010 1:46:57 am

Hi Hakim,

Don't know if you've found something to make it work on your side ... Theses days I was working on a similar thing. Here is the workaround I've found :

Edit your site.ini like that :

[Session]
SessionNameHandler=custom
SessionNamePerSiteAccess=disabled

Set a common cookie_domain for all your sub domains! To do that you can edit your apache virtual_host and add that line into it :

php_value session.cookie_domain ".mysite.com"

Or you can redefine that php option directly in ez publish by editing the config.php file (in the root of your install) by adding that :

$hostSlices = explode('.', $_SERVER['SERVER_NAME']);
$hostSlices = array_slice($hostSlices, -2, 2);
$hostName = join('.', $hostSlices);
ini_set('session.cookie_domain', '.'.$hostName);

Hope it will be useful for several of us ;)

Gabriel Finkelstein

Wednesday 15 September 2010 10:05:30 am

Maybe this is what you need:

http://share.ez.no/articles/ez-publish/using-a-sso-in-ez-publish/

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 01:56:53
Script start
Timing: Jan 18 2025 01:56:53
Module start 'layout'
Timing: Jan 18 2025 01:56:53
Module start 'content'
Timing: Jan 18 2025 01:56:53
Module end 'content'
Timing: Jan 18 2025 01:56:53
Script end

Main resources:

Total runtime0.7835 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.1719152.6563
Module start 'layout' 0.00530.0026 740.828139.5078
Module start 'content' 0.00790.7741 780.3359592.4609
Module end 'content' 0.78200.0015 1,372.796912.0938
Script end 0.7835  1,384.8906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4031160.0002
Check MTime0.00130.1658160.0001
Mysql Total
Database connection0.00070.089110.0007
Mysqli_queries0.706590.1759620.0114
Looping result0.00070.0937600.0000
Template Total0.755096.420.3775
Template load0.00190.248520.0010
Template processing0.753096.112320.3765
Template load and register function0.00030.031910.0003
states
state_id_array0.00150.197510.0015
state_identifier_array0.00150.192720.0008
Override
Cache load0.00180.2314730.0000
Sytem overhead
Fetch class attribute can translate value0.00100.127030.0003
Fetch class attribute name0.00140.177870.0002
XML
Image XML parsing0.00440.565130.0015
class_abstraction
Instantiating content class attribute0.00000.001980.0000
General
dbfile0.00470.5989270.0002
String conversion0.00000.000840.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
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
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
12content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ol.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ol.tplEdit templateOverride template
12content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 58
 Number of unique templates used: 11

Time used to render debug report: 0.0002 secs