미

jquery cookie

· 2011-11-20 (일) 21:20:38 · 5470 · 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,731
11-11-29 조회 4,990
11-11-29 조회 3,748
11-11-28 조회 3,785
11-11-25 조회 8,770
11-11-25 조회 5,783
11-11-24 조회 5,145
11-11-23 조회 4,702
11-11-20 조회 2.6만
11-11-20 조회 5,471
11-11-20 조회 9,187
11-11-17 조회 3,994
11-11-14 조회 7,782
11-11-11 조회 4,790
11-11-11 조회 4,830
11-11-11 조회 5,409
11-11-11 조회 4,445
11-11-11 조회 3,322
11-11-09 조회 4,171
11-11-09 조회 7,119