Jump to content

Setting cookies no longer working in Mozilla FireFox


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 post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...