I have created a very simple ASP.Net MVC project with a single .cshtml file and 3 lines of Javascript as below -
<script type="text/javascript">
$(document).ready(function () {
alert(document.cookie);
document.cookie = "c1=1;expires=Thu, 01 Jan 2025 00:00:00 GMT;";
alert(document.cookie);
});
When running the application via Visual studio, the above code displays cookies in Firefox but not in Google Chrome. Please advise on what could be the issue.
I have checked these links - 1 & 2
Please note that I do not want to change the hosts file on my local machine. Please advise on how can I get cookies working on my local machine on Chrome.