Hi Wahid,
Thank you for your post. Actually, the Session variable specifies the culture code for the controls, the cookie is used only for page templates since the URL Rewriting engine doesn't have access to the session.
Your code seems to be fine. Here's another method that is new and it's not mentioned in the documentation yet (we will add it soon): you can create a link href="?lang=en-ca". It calls the same page and the Global.asax code sets the culture correctly.
It's ensured by this method:
public void Application_AcquireRequestState( object sender, EventArgs e )
{
// set language if required
if ( ( !( Request.QueryString[ "lang" ] == null ) ) && Request.QueryString[ "lang" ] != "" )
{
Session[ "CMSPreferredCulture" ] = Request.QueryString[ "lang" ];
}
}
Unfotunately, this code does not set the cookie variable - we will add it in the nearest release. You can add the following line now:
Response.Cookies["CMSPreferredCulture"].Value = "en-ca";
Please let me know if this helps.
Regards,