<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -91,13 +91,17 @@
     
     setCookie: function(state,val) {
       if(!$.cookie()||!state.length) return false;
-      $.cookie(state, val ? 'yes' : null, {&quot;path&quot;:&quot;/&quot;});
+      $.cookie(this.prefixed(state), val ? 'yes' : null, {&quot;path&quot;:&quot;/&quot;});
       return true;
     },
     
     getCookie: function(state) {
       if(!$.cookie()||!state.length) return false;
-      $.cookie(state)!=null;
+      $.cookie(this.prefixed(state))!=null;
+    },
+    
+    prefixed: function(str){
+      return this.options.prefix+this.options.separator+str;
     },
     
     bindEvents: function(){
@@ -135,7 +139,7 @@
         for(var state in states) {
           if(self.states[states[state]]==undefined &amp;&amp; states[state]!='') {
             if($.cookie()){ 
-              self.states[states[state]]=$.cookie(states[state]) != null;
+              self.states[states[state]]=self.getCookie(states[state]);
             } else {
               self.states[states[state]]=false;
             }</diff>
      <filename>lib/polypage.jquery.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,22 @@
 Screw.Unit(function() {
   describe(&quot;PolyPage Cookie&quot;, function() {
+    it(&quot;stores state in a cookie when switched on&quot;, function() {
+      $('#dom').trigger('pp_setState', { logged_in:false });
+      $('#dom').trigger('pp_setState', { logged_in:true });
+      expect($.cookie('pp_logged_in')).to(equal, 'yes');
+    });
     
+    it(&quot;stores forgets state in a cookie when switched off&quot;, function() {
+      $('#dom').trigger('pp_setState', { logged_in:true });
+      $('#dom').trigger('pp_setState', { logged_in:false });
+      expect($.cookie('pp_logged_in')).to(equal, null);
+    });
+    
+    it(&quot;stores state in a cookie when toggled&quot;, function() {
+      $('#dom').trigger('pp_toggleState', 'logged_in');
+      expect($.cookie('pp_logged_in')).to(equal, 'yes');
+      $('#dom').trigger('pp_toggleState', 'logged_in');
+      expect($.cookie('pp_logged_in')).to(equal, null);
+    });
   });
 });
\ No newline at end of file</diff>
      <filename>spec/polypage-cookie-spec.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>23d0a2b0cbbf7d764114c7647b2f6d2a9ced7349</id>
    </parent>
  </parents>
  <author>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </author>
  <url>http://github.com/andykent/polypage/commit/79272d02d57646b4a187db3c9c9179493689a009</url>
  <id>79272d02d57646b4a187db3c9c9179493689a009</id>
  <committed-date>2009-04-12T10:27:03-07:00</committed-date>
  <authored-date>2009-04-12T10:27:03-07:00</authored-date>
  <message>prefix cookies correctly</message>
  <tree>00832c4bfb5a22ee584910d9a1f5b3f095f08b7d</tree>
  <committer>
    <name>Andy Kent</name>
    <email>andrew.d.kent@gmail.com</email>
  </committer>
</commit>
