开发者

Cookie not set. Why?

开发者 https://www.devze.com 2023-03-18 09:24 出处:网络
I wanna set a cookie with jQuery, I went through some Qestions with similar title in stackoverflow, but they didnt solved the problem

I wanna set a cookie with jQuery, I went through some Qestions with similar title in stackoverflow, but they didnt solved the problem

here is my code

      $(document).ready(function() {
      alert("Test");

      $.cookie('iwiNews', 'login', { path: '/', expires: 1 });
      alert( $.cookie("iwiNews") );
      });

I also tried

          $(document).ready(function() {
      alert("Test");

      $.cookie('iwiNews', 'login');
      alert( $.cookie("iwiNews") );
      });

and

开发者_开发问答
          $(document).ready(function() {
      alert("Test");

      $.cookie('iwiNews', 'login' {expires: 1 });
      alert( $.cookie("iwiNews") );
      });

The alert "Test" is to check if the actionhandler works, the alert wich returns the cookie value doesnt fire at all. The coodie isnt set if I look up the cookie list in Firefox. Somebody has an Idea why? thanks a lot in advance, daniel

0

精彩评论

暂无评论...
验证码 换一张
取 消