Need Advice On Setting Cookie For Multilingual Site

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
ntarantino
Forum Newbie
Posts: 1
Joined: Sat Oct 09, 2010 5:03 am

Need Advice On Setting Cookie For Multilingual Site

Post by ntarantino »

Hi,

I have been bouncing my head for the past few days trying to figure this out and finally I figured I needed to google a forum where to ask people who actually know what they are talking about.

I have a 4 language site built on a cms and I am trying to create a splash page that displays each language so you can choose which language you need. My issue is once you click the language and go back to the home domain, it defaults to English.

The code I been playing with is below. Can anyone help me figure out what I need to do so I set the cookie properly?

Thanks for any help or direction!

Code: Select all

<script LANGUAGE="JavaScript">
<!-- hide from old browsers
function setCookie(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function setsplash() {
setCookie("splash", "1", "", "/");
}
//-->
</SCRIPT>

<div id="splash">
<div class="splash content">
<div class="splash enter">
<ul>
<li class="en"><a onclick="setsplash()" href="" title="English">English</a></li>
<li class="nl"><a onclick="setsplash()" href="http://b-e-m.org/nl/" title="Nederlands">Nederlands</a></li>
<li class="fr"><a onclick="setsplash()" href="http://b-e-m.org/fr/" title="Français">Français</a></li>
<li class="de"><a onclick="setsplash()" href="http://b-e-m.org/de/" title="Deutsch">Deutsch</li>
</ul>

</div>
</div>
</div>
Post Reply