"use strict";

$(document).ready(function() {
    $("#link_play").click(function (event) {
        $.cookie("user_name", $("#credentials").find("input#username").val());
        return true;
    });
});

"use strict";

$(document).ready(function() {
    $("#link_play").click(function (event) {
        $.cookie(
            "user_name",
            $("#credentials").find("input#username").val(),
            {path: "/page/"}
        );
        return true;
    });
});

Set user name cookie only for the /page/ path where it is used.
Set user name cookie only for the /page/ path where it is used.
