Support » Plugins » Hacks » Help with setting Cookies

  • ntarantino


    I am trying to create a splash page (I know not the best, but my friend wants it) where you can pick which language to visit the site.


    I would like when they click a language that when they go off the site when they come back it remembers which language they pick.

    I have tried a plugin that has helped a bit to get started, but I am not sure how to set a cookie for each language. Here is where I am at:

    <?php get_header(); ?>
    <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", "", "/");
    <div id="splash">
    	<div class="splash content">
    	<div class="splash enter">
    		<li class="en"><a onclick="setsplash()" href="" title="English">English</a></li>
    		<li class="nl"><a onclick="setsplash()" href="" title="Nederlands">Nederlands</a></li>
    		<li class="fr"><a onclick="setsplash()" href="" title="Français">Français</a></li>
    		<li class="de"><a onclick="setsplash()" href="" title="Deutsch">Deutsch</li>
    <?php get_footer(); ?>

    Any help with my lack of php 🙂

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Help with setting Cookies’ is closed to new replies.