<script src="/Scripts/jQuery-1.2.6.js" type="text/javascript"></script>

<%-- jQuery.cookie.js在這裡下載

 http://plugins.jquery.com/project/cookie--%>

 <script src="/Scripts/jQuery.cookie.js" type="text/javascript"></script>

 <script type="text/javascript">

                //設定Cookie,5天後過期,如果不設定時間就是瀏覽器關掉就不見

                 $.cookie('welkin_cookie', 'myValue', { path:'/', expires: 5 });                   

 

                //設定Cookie,同樣也是5天後過期,用毫秒表示           

                 var date = new Date();

                 date.setTime(date.getTime() + (5 * 24 * 60 * 60 * 1000));

                 $.cookie('welkin_cookie', 'myValue', { path:'/', expires: date });

 

                 //取得Cookie的值,若無則返回null

                 $.cookie('welkin_cookie');

 

                 //刪除Cookie

                 $.cookie(COOKIE_NAME, null, { path: '/', expires: 5 });

                 //

                 $.cookie('welkin_cookie', null);

                 //

                 $.cookie('welkin_cookie', { expires: -1 });

                  

</script>

welkingunther 發表在 痞客邦 PIXNET 留言(0) 人氣()