미

jquery cookie

· 2011-11-20 (일) 21:20:38 · 5461 · 3

Installation

Include script after the jQuery library (unless you are packaging scripts somehow else):

<script src="/path/to/jquery.cookie.js"></script>

Usage

Create session cookie:

$.cookie('the_cookie', 'the_value');

Create expiring cookie, 7 days from then:

$.cookie('the_cookie', 'the_value', { expires: 7 });

Create expiring cookie, valid across entire page:

$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' });

Read cookie:

$.cookie('the_cookie'); // => 'the_value'
$.cookie('not_existing'); // => null

Delete cookie by passing null as value:

$.cookie('the_cookie', null);
|

댓글 3개

오 쿠키 플러그 인이군요 간단하네요
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
11-11-30 조회 4,714
11-11-29 조회 4,973
11-11-29 조회 3,738
11-11-28 조회 3,771
11-11-25 조회 8,755
11-11-25 조회 5,771
11-11-24 조회 5,131
11-11-23 조회 4,690
11-11-20 조회 2.6만
11-11-20 조회 5,462
11-11-20 조회 9,176
11-11-17 조회 3,983
11-11-14 조회 7,764
11-11-11 조회 4,777
11-11-11 조회 4,816
11-11-11 조회 5,393
11-11-11 조회 4,436
11-11-11 조회 3,307
11-11-09 조회 4,160
11-11-09 조회 7,103