Problem with authentication and i18n

Author Message

Sergei Chusmah

Friday 24 August 2007 4:59:26 am

I have a site in several languages, with a host method for selecting the language (i.e. example.com, fr.example.com, de.example.com) the version os 3.6
The problem is when a user logs in to example.com, and then switches the language, it redirects him to the user login page again. Maybe the stored cookies are valid only for a host name...

How can I solve this?

Also, the language code is not available to all my templates, is there a way to include it somehere so it is available to all templates?

One last question, is there a common variable which stores the current host url (i.e. en.example.com). Maybe in the ·site array? Is there a doc where its contents are described?

Thanks a lot!

Christophe Condomines

Friday 24 August 2007 6:28:21 am

> Maybe the stored cookies are valid only for a host name

Yes, by default, a cookie is limited to the hostname. You may change your siteaccess selection to something like www.example.com/fr www.example.com/de to be able to share the session between the different siteaccess.
You should also have a look to the session configuration:
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/configuration_files/site_ini/session

> the language code is not available to all my templates
I'm not sure to understand your question. May be getting the settings with the ezini operator is sufficient: ezini('RegionalSettings','locale') or something similar.

> Is there a common variable which stores the current host url
Yes, ezsys is the operator you are looking for. Have a look to the documentation:
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/data_and_information_extraction/ezsys

Good luck,

Microblau SL
http://www.microblau.net

Sergei Chusmah

Tuesday 28 August 2007 2:36:10 am

Thanks for your reply, it has been very useful!

Regarding cookies, I think they can be set to a whole domain (i.e. *.example.com) with the syntax ".example.com", don't know if that would work in ez...

ezsys and ezini solved my other problems, thanks :)

Christophe Condomines

Tuesday 28 August 2007 3:10:51 am

> <i>Thanks for your reply, it has been very useful!</i>
You're welcome.

> <i>Regarding cookies, I think they can be set to a whole domain (i.e. *.example.com) with the syntax ".example.com", don't know if that would work in ez...</i>

You're right, a cookie on "example.com" should work for every sub-domain. The main problem here is that you can not configure this in eZPublish. If you really want this, you have to hack the session's library. You also may send a request for enhancement for this feature at http://issues.ez.no

Regards.

Microblau SL
http://www.microblau.net

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.