Forums / Developer / Session & SiteAccess

Session & SiteAccess

Author Message

Fou Jino

Monday 07 March 2011 2:46:17 am

Hi everyone,

I have a probleme when I use the session variables.

Thus, I created a module which called with a form to identify a user. My module check user email & user pass (with webservice not ez publish user). If all values correct or not the module, it store the result in session with eZHTTPTool::setSessionVariable( "loginErrors", $loginErrors ); and then it redirect the user with eZHTTPTool::redirect( $redirect );

In the redirected template I can display the result BUT if I change the language (siteaccess) the result is showed ...

I don't understand :s

Does anyone can help me ? Big thanks in advance !!

Foujino ~ http://www.foujino-blog.be

Damien Pobel

Monday 07 March 2011 2:56:30 am

Hi,

this is because session are specific to a siteaccess with the default settings. You can change this behaviour in site.ini/[Session]/SessionNamePerSiteAccess

Note : this can only work if the domain of the siteaccesses that should share the session is the same.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Fou Jino

Monday 07 March 2011 2:58:13 am

In fact, I observe that may be its a refresh probleme

Because when, in the current siteaccess I can show the session value now but, if I can submit my forms again, the session value of current siteacces not change but if I change de siteaccess the value is updated in this siteaccess :s:s

Foujino ~ http://www.foujino-blog.be

Fou Jino

Monday 07 March 2011 3:15:09 am

Damien, here my site.ini :

[Session]

SessionNameHandler=default

SessionNamePerSiteAccess=enabled

Foujino ~ http://www.foujino-blog.be

Damien Pobel

Monday 07 March 2011 4:12:12 am

I guess the behaviour you describe comes from the fact that the module is called on the wrong siteaccess. Setting SessionNamePerSiteAccess to disabled should make the system behaves like you want.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Fou Jino

Tuesday 08 March 2011 1:38:10 am

Ok Damien, you are right for the SessionNamePerSiteAccess parameters but it's also a refresh problem

I resolved my issue, I created a template only for my module and then the session value is showed and refreshed (when it changed) correctly

Thank you !

Foujino ~ http://www.foujino-blog.be

eZ debug

Timing: Jan 18 2025 10:35:35
Script start
Timing: Jan 18 2025 10:35:35
Module start 'content'
Timing: Jan 18 2025 10:35:36
Module end 'content'
Timing: Jan 18 2025 10:35:36
Script end

Main resources:

Total runtime0.9067 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 588.7422180.8516
Module start 'content' 0.00730.7594 769.5938570.3672
Module end 'content' 0.76670.1400 1,339.9609337.3984
Script end 0.9067  1,677.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4625210.0002
Check MTime0.00160.1727210.0001
Mysql Total
Database connection0.00090.103010.0009
Mysqli_queries0.827791.28482040.0041
Looping result0.00230.25082020.0000
Template Total0.874296.420.4371
Template load0.00240.265920.0012
Template processing0.871896.144620.4359
Template load and register function0.00030.034410.0003
states
state_id_array0.00140.150110.0014
state_identifier_array0.00200.219520.0010
Override
Cache load0.00210.2263320.0001
Sytem overhead
Fetch class attribute can translate value0.00270.299330.0009
Fetch class attribute name0.00110.123370.0002
XML
Image XML parsing0.00090.101230.0003
class_abstraction
Instantiating content class attribute0.00000.001680.0000
General
dbfile0.00230.2528270.0001
String conversion0.00000.001130.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.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.0002 secs