Forums / Install & configuration / Multi siteaccess - clear session cookie on registration

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

eZ debug

Timing: Jan 17 2025 23:48:28
Script start
Timing: Jan 17 2025 23:48:28
Module start 'content'
Timing: Jan 17 2025 23:48:28
Module end 'content'
Timing: Jan 17 2025 23:48:29
Script end

Main resources:

Total runtime0.1586 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 589.6016180.8047
Module start 'content' 0.00690.0061 770.4063102.0859
Module end 'content' 0.01290.1455 872.4922530.9063
Script end 0.1584  1,403.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00372.3297200.0002
Check MTime0.00140.8804200.0001
Mysql Total
Database connection0.00120.751010.0012
Mysqli_queries0.111069.98751410.0008
Looping result0.00140.89321390.0000
Template Total0.145191.510.1451
Template load0.00100.657510.0010
Template processing0.144190.836810.1441
Override
Cache load0.00060.390410.0006
Sytem overhead
Fetch class attribute can translate value0.00080.501110.0008
XML
Image XML parsing0.00040.258510.0004
General
dbfile0.00171.0450200.0001
String conversion0.00000.003230.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs