我正在使用来保存Cookie,然后在jQuery中访问它。
$( document ).on( 'click', '#ai1ec-calendar-view .ai1ec-load-event', function( e ) {
e.preventDefault();
$.cookie.raw = true;
$.cookie( 'ai1ec_calendar_url', document.URL );
window.location.href = this.href;
} );但是,如果我将其转储到PHP中,我会得到添加双引号的结果,如下图所示。发生什么事了呢?

发布于 2013-12-29 02:36:43
这个问题与cookie字符串应该被引用的事实有关,因此jQuery Cookie添加了双引号。PHP中的解决方案是使用json_decode
$href = json_decode( $_COOKIE['ai1ec_calendar_url'] );https://stackoverflow.com/questions/20817870
复制相似问题