Shinori Posted March 22, 2019 Share Posted March 22, 2019 Hey, having trouble with creating cookies in firefox. I've tested it in chrome and edge and it seems to be working fine. But on firefox (Quantum 66.0 (64-Bit)) the cookies is not being created and i don't know why. Do you habe any ideas why it's not working? I've read sth about "secure cookies in firefox". Thanks in advance :) Im actually using W3s setCookie piece of code: function setCookie(name,value,days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + escape(decodeURI(value)) + ";" + expires + "; path=/"; } Creating the cookie with: function login() { var email = document.getElementById("email").value; var psw = document.getElementById("psw").value; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { if(this.responseText == "false") { popup("login_error.php"); } else { setCookie("nydoo_minecraft_member",this.responseText,1); window.location.reload(); } } }; xmlhttp.open('POST',"/resources/login.php?email=" + email + "&psw=" + psw, true); xmlhttp.send(); } Link to comment Share on other sites More sharing options...
dsonesuk Posted March 22, 2019 Share Posted March 22, 2019 Clear cache/history, and check accepting of cookies has not been changed, setting to default 'standard' should allow most. Link to comment Share on other sites More sharing options...
Shinori Posted March 22, 2019 Author Share Posted March 22, 2019 I reinstalled firefox. Still no change 😕 Any ideas ? Link to comment Share on other sites More sharing options...
justsomeguy Posted March 22, 2019 Share Posted March 22, 2019 Are you uploading that file to a web server and accessing it over HTTP? Link to comment Share on other sites More sharing options...
Shinori Posted March 22, 2019 Author Share Posted March 22, 2019 I'm using Plesk shared services. Uploading the file via SFTP to the Webservers directory. Accessing the page via HTTPS Link to comment Share on other sites More sharing options...
Ingolme Posted March 22, 2019 Share Posted March 22, 2019 Is your code running inside a frame on another website? Link to comment Share on other sites More sharing options...
Shinori Posted March 23, 2019 Author Share Posted March 23, 2019 No. Simply using it on usual html elements. 😕 Link to comment Share on other sites More sharing options...
Shinori Posted April 4, 2019 Author Share Posted April 4, 2019 Bump Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now