如何自动清理我网站上的cookie

时间:2015-01-21 11:39:10

标签: cookies

我想知道如何自动清理我的IPB论坛上的cookie

我有语言转换器和库存我希望它正确使用

ipb.Cookie.set('ips_lang_c',1,1);

1 个答案:

答案 0 :(得分:0)

<script type="text/javascript" charset="utf-8">
document.observe('dom:loaded', function(e) {
    var lang_choosed = ipb.Cookie.get('ips_lang_c');
    if(!lang_choosed) {
        new ipb.Popup( 'lang_popup', {
            type: 'pane',
            modal: true,
            initial: $('lang_dialog').innerHTML,
            hideAtStart: false,
            w: '500px',
            h: '42px'
        });
        ipb.Cookie.set('ips_lang_c',1,1);
    }
});
</script>

<div id="lang_dialog" style='display:none;'>
    <h2>Выберите язык:</h2>
    <ul>
    <if test="langchooser:|: ! $this->member->is_not_human && count( $footer_items['lang_chooser']['options'] ) > 1">
        <foreach loop="$footer_items['lang_chooser']['options'] as $lang">
            <li>
                <a href="{parse url="{$this->settings['query_string_formatted']}&amp;k={$this->member->form_hash}&amp;setlanguage=1&amp;langurlbits={$this->settings['query_string_safe']}&amp;cal_id={$this->request['cal_id']}&amp;langid={$lang['id']}" base="public"}" title='{$lang['title']}'>{$lang['title']}</a>
            </li>
        </foreach>
    </if>   
    </ul>
</div>

脚本看起来像这样