Jump to content

Setting cookies no longer working in Mozilla FireFox


Shinori

Recommended Posts

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

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...