Forums / Developer / Session & SiteAccess
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
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
Monday 07 March 2011 3:15:09 am
Damien, here my site.ini :
[Session]
SessionNameHandler=default
SessionNamePerSiteAccess=enabled
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.
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 !