30 minutes is 30 * 60 * 1000
miliseconds. Add that to the current date to specify an expiration date 30 minutes in the future.
var date = new Date();
var minutes = 30;
date.setTime(date.getTime() + (minutes * 60 * 1000));
$.cookie("example", "foo", { expires: date });
More Related Contents:
- How do you increment a cookie value?
- How do I set/unset a cookie with jQuery?
- Display A Popup Only Once Per User
- Can jQuery read/write cookies to a browser?
- Cross domain POST request is not sending cookie Ajax Jquery
- jQuery $.cookie is not a function
- I want to store Javascript array as a Cookie
- Best way to store small UI user preferences in web app? [closed]
- How do I edit PHP variable with JavaScript/jQuery?
- How to check first 200 chekboxes , then next 200 and so on?
- How can I access the contents of an iframe with JavaScript/jQuery?
- Pure JavaScript equivalent of jQuery’s $.ready() – how to call a function when the page/DOM is ready for it [duplicate]
- Is Safari on iOS 6 caching $.ajax results?
- Prevent scrolling of parent element when inner element scroll position reaches top/bottom?
- Refresh/reload the content in Div using jquery/ajax
- How to delete a localStorage item when the browser window/tab is closed?
- Get list of data-* attributes using javascript / jQuery
- How to print all the txt files inside a folder using java script
- How to handle floats and decimal separators with html5 input type number
- Loop through JSON object List
- Clearing my form inputs after submission
- Get the domain name of the subdomain Javascript
- Is there any problem with using HTML5’s “data-*” attributes for older browsers?
- console.log(result) prints [object Object]. How do I get result.name? [duplicate]
- jQuery: more than one handler for same event
- Disable zoom on input focus in Android webpage
- Add image in pdf using jspdf
- Queue AJAX calls
- What is the difference between $(document).ready(function() and $(function() ?
- How to post ASP.NET MVC Ajax form using JavaScript rather than submit button