Completed
Last Updated: 24 Mar 2023 10:55 by ADMIN
Kim
Created on: 29 Jun 2021 12:29
Category: UI for ASP.NET MVC
Type: Bug Report
0
Chrome page errors: "Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute"
When using the CDN service to load scripts and styles Chrome v91 shows "Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute" errors related to cookies from the .telerik.com domain
4 comments
ADMIN
Aleksandar
Posted on: 03 Mar 2022 13:11

Hello Sunitha,

You need to add the scripts to the wwwroot folder and set the path to point to them, for example:

<environment include="Development">
        ...

        <script src="~/lib/jquery/dist/jquery.js"></script>

        @* Place the Kendo UI scripts after jQuery. *@
        <script src="~/lib/kendo-ui/js/kendo.all.min.js"></script>
        <script src="~/lib/kendo-ui/js/kendo.aspnetmvc.min.js"></script>
    </environment>

For adding the Client-side resources for Telerik UI for ASP.NET Core refer to the respective documentation section here. If general guidance on static resources is required I suggest the official MSDN documentation.

Regards,
Aleksandar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Sunitha
Posted on: 24 Feb 2022 19:49

Hi Aleksander,

I am also facing same script error while using VS2022 ASP.NET Core MVC app. How can i set the paths in _layout.cshtml in asp.net core mvc app?

 

Thanks

ADMIN
Aleksandar
Posted on: 30 Jun 2021 08:16

Hi Laura,

An alternative CDN that can be used is cdn.kendostatic.com:

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@ViewBag.Title - My Telerik MVC Application</title>

    <link rel="stylesheet" href="https://cdn.kendostatic.com/2021.2.616/styles/kendo.default-v2.min.css">

    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
    <script src="https://cdn.kendostatic.com/2021.2.616/js/kendo.all.min.js"></script>
    <script src="https://cdn.kendostatic.com/2021.2.616/js/kendo.aspnetmvc.min.js"></script>
</head>

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Aleksandar
Posted on: 29 Jun 2021 12:51

Hi Laura,

Thank you for reporting this issue. The errors are logged as the CDN service has the same domain name as the www.telerik.com site, thus when using it to load scripts and styles any cookies stored associated with the www.telerik.com site will be flagged as non-compliant an the errors you see are logged.

To resolve the errors logged by Chrome, until the issue is fixed, you can serve the scripts from the application instead of relying on the CDN service:

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@ViewBag.Title - My Telerik MVC Application</title>
    <link href="~/Content/kendo.default-v2.min.css" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="~/Scripts/jquery.min.js"></script>
    <script src="~/Scripts/kendo.all.min.js"></script>
    <script src="~/Scripts/kendo.aspnetmvc.min.js"></script>
    <script src="@Url.Content("~/Scripts/bootstrap.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
</head>

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.