-4

I want to enable the cookie of client browser using javascript. Actually, I have a popup showing check boxes, if checked true means cookie to be enabled and if the cookie is disabled I want a built in browser prompt for asking the user to enable the cookie.

so, is it possible using javascript to enable or disable cookies from client web page? actually, I want to take user permission for enabling the cookie, by click on a single button.

vimalraturi
  • 343
  • 1
  • 4
  • 17
  • 1
    `I want to enable the cookie of client browser using javascript` - you can't change a user preference - period – Jaromanda X Apr 10 '17 at 09:02
  • 2
    `"i want a built in browser prompt for asking user to enable the cookie"` - Here you go: `alert('Please enable cookies.');` – David Apr 10 '17 at 09:04
  • If you want to detect cookie enabled in js and then prompt the user, this question is the same: http://stackoverflow.com/questions/8112634/jquery-detecting-cookies-enabled – elpddev Apr 10 '17 at 09:07

1 Answers1

4

No You can't enable cookies using Javascript, Browsers don't allow that!

Arjun
  • 2,777
  • 14
  • 32