answersLogoWhite

0

Can you make cookies in javascript?

Updated: 8/20/2019
User Avatar

Wiki User

10y ago

Best Answer

Yes, by using jQuery and Klaus Hartl's jQuery-cookie plugin (link at the end). Using this plugin you can use:

To create a cookie:

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

To read the cookie:

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

To delete the cookie:

// Returns true when cookie was found, false when no cookie was found... $.removeCookie('the_cookie');

Source:

https://github.com/carhartl/jquery-cookie

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you make cookies in javascript?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is it possible to access browser cookies from javascript?

Yes, it is possible to access browser cookies from JavaScript. It can be done using cookies keyword inside it.


How do you prevent information about your computer being leaked via javascript?

Most browsers allow you to disable cookies. This would prevent any javascript function from collecting data about your computer. Unfortunately, cookies can be very useful. They remember logins and passwords for you, and can help make a webpage more interactive. As long as you stay on safe websites, you shouldn't worry about javascript cookies.


I have checked and I have all the latest flash player installments but it will not let me see some videos but it will with others and I don't mean the over 18 ones?

Make sure you have cookies and Javascript enabled.


Can you make softwares using javascript and if so how and by the way I do mean Javascript NOT java?

You can't make software, but you can make scripts that can be called from a program.


How can you call a flash file in JavaScript?

what you could do is make the file an HTML file and have embedded Javascript in it. i am not sure how to put a flash file into Javascript though.


Should you make cookies?

When in doubt, make cookies.


How do you make a car rental scheme using javascript?

You need JavaScript and HTML to make car rental scheme. You might also need a middleware.


Do puretoricans make cookies?

yes they make chocolate chip cookies


How to make cookies?

You can make cookies by reading the box with cookie mix.


How is javascript used?

JavaScript is used to make HTML DHTML or Dynamic HTML. Provides a lot more interactivity between the web page and the browser provided JavaScript is not turned off.


How do you make the title on your Tumblr type itself?

With javascript.


What is the different between cookies and history?

Well, you eat cookies, and I sure hope you don't eat history. I know one similarity. You can make cookies and you can make history. Or you can make history by making really good cookies. Or you can make historical cookies. Or you can eat cookies while making history. Or you can eat history while making cookies.