Xml Saving and Loading Problems

In my game, I have added a remember function for my login/register thingy. The code is as follows:
Here is my LoginInfo class for the XmlRoot

@XmlRoot("LoginInfo")
public class LoginInfo{
	
	@XmlAttribute("username")
	public var username : String = "";

	@XmlAttribute("password")
	public var password : String = "";

	@XmlAttribute("rememeber")
	public var remember : boolean = false;
}

And to use this I have a function called Save() and Load()

function Save(path : String){
	var serializer : XmlSerializer = new XmlSerializer(LoginInfo);
	var stream : Stream = new FileStream(path, FileMode.Create);
	serializer.Serialize(stream, loginInfo);
	stream.Close();
}

function Load(path : String) : LoginInfo{
	var serializer : XmlSerializer = new XmlSerializer(LoginInfo);
	var stream : Stream = new FileStream(path, FileMode.Open);
	var result : LoginInfo = serializer.Deserialize(stream) as LoginInfo;
	stream.Close();
	return result;
}

This works perfectly for the editor game window thing, but when I play it with a build it does not seem to work. Also in the editor console, sometimes this line comes up:

ms_IDToPointer->find (obj->GetInstanceID ()) == ms_IDToPointer->end ()

Any help is appreciated,
william9518

it may be related to your target platform,You can use PlayerPrefs instead.