Multi siteaccess - clear session cookie on registration

Author Message

Tom W

Wednesday 08 September 2010 2:32:21 pm

Hello,

I'm building a site with 2 siteaccess.
Each one uses a different user class.

The problem I'm facing is that when a person goes from one registration to the other, something is cached in the session cookie, both registration forms end up using the same user class.
Is there any configuration I can set that will remove/timeout the session cookie when a person navigates to the registration page of another siteaccess?

I do see some session settings in the site.ini documentation, though I'm not sure which would work.
Alternatively, is there something in the form of a template operator/function I can call on the template to clear the cookie?

Thanks,

André R.

Thursday 09 September 2010 12:17:14 am

You should enable pr siteaccess sessions using

in site.ini.append.php override or the two siteaccesses in question:
[Session]
SessionNamePerSiteAccess=enabled

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

Ivo Lukac

Thursday 09 September 2010 12:19:17 am

Hi Tom,

We had the exact same problem. There is no ini setting for that. The only solution is to replace session variable "RegisterUserID" with something like "RegisterUserID_".$user_class_id so it will be different for different siteaccess. To do that you need to hack the user/register.php or make custom module with original register.php changed.

Cheers

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Ivo Lukac

Thursday 09 September 2010 12:21:12 am

"

You should enable pr siteaccess sessions using

in site.ini.append.php override or the two siteaccesses in question:
[Session]
SessionNamePerSiteAccess=enabled

"

I think this is default and it does not help :(

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

André R.

Thursday 09 September 2010 1:09:25 am

The default is disabled (its written to your siteaccess during setup) at least for frontend siteaccesses in flow / webin.

Additionally you'll need SessionNameHandler=custom so that above setting actually does anything.

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

Ivo Lukac

Thursday 09 September 2010 2:18:18 am

"

The default is disabled (its written to your siteaccess during setup) at least for frontend siteaccesses in flow / webin.

Additionally you'll need SessionNameHandler=custom so that above setting actually does anything.

"

Hm, I can't be sure now (it was months ago), but I think we have experimented with that but with no luck.

But it is easier to first try with ini setting, that's for sure.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Tom W

Thursday 09 September 2010 8:19:45 am

Thank you very much André and Ivo.
The session config solution works.

[Session]
SessionNameHandler=custom
SessionNamePerSiteAccess=enabled
SessionNamePrefix=something_
Using a different prefix for each siteaccess of course. (in case anyone else is looking at this)
In addition to these settings, when logged in from one siteaccess, other siteaccess sees the user as logged in as well.
(this was one of my concerns, because I have 2 more siteaccess to control the languages)

Tested under Ez Publis 4.3.0, PHP 5.2.8

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 02:19:13
Script start
Timing: Jan 18 2025 02:19:13
Module start 'layout'
Timing: Jan 18 2025 02:19:13
Module start 'content'
Timing: Jan 18 2025 02:19:14
Module end 'content'
Timing: Jan 18 2025 02:19:14
Script end

Main resources:

Total runtime0.7498 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.2813152.6563
Module start 'layout' 0.00530.0031 741.937539.5234
Module start 'content' 0.00840.7401 781.4609637.8125
Module end 'content' 0.74850.0013 1,419.273420.1094
Script end 0.7498  1,439.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4395160.0002
Check MTime0.00140.1884160.0001
Mysql Total
Database connection0.00080.110810.0008
Mysqli_queries0.684791.3147710.0096
Looping result0.00060.0756690.0000
Template Total0.722396.320.3611
Template load0.00220.294520.0011
Template processing0.720196.031220.3600
Template load and register function0.00010.016310.0001
states
state_id_array0.00060.084410.0006
state_identifier_array0.00100.136720.0005
Override
Cache load0.00190.2576520.0000
Sytem overhead
Fetch class attribute can translate value0.00050.072930.0002
Fetch class attribute name0.00090.125290.0001
XML
Image XML parsing0.00110.144430.0004
class_abstraction
Instantiating content class attribute0.00000.0033120.0000
General
dbfile0.00100.1319240.0000
String conversion0.00000.001340.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
7content/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
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 38
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs