Solve the problem that vue project cannot carry cookies when started locally

Solve the problem that vue project cannot carry cookies when started locally

Solve the problem that the vue project can be packaged and deployed to the server and can log in normally, but cannot carry cookies when started locally

Let me talk about the problem: the company's old project was cloned from gitLab. After starting it, I logged in and the interface returned a successful login. Then when I called other interfaces, it returned that I was not logged in. I checked the request header and found that no cookies were carried. Therefore, when I called the interface, it prompted that I was not logged in.
However, after the same code was packaged and deployed, everything was normal. Cookies were carried when the interface was called. After searching on Baidu, the problem was finally solved.

I am using Google Chrome browser

The solution steps are as follows:

1. Visit chrome://flags in the browser address bar

insert image description here

2. Search for SameSite in the search box and change the status Disabled

insert image description here

3. After saving, close the browser and reopen it

After I did the above operations, the locally started project can carry cookies normally when sending requests.

This is the end of this article about solving the problem of not being able to carry cookies when the Vue project is started locally. For more relevant content about Vue not being able to carry cookies, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Solution to the error "cannot GET /service" when starting a vue project
  • Vue modify project startup port number method
  • Detailed explanation of how to start running the dist file generated after webpack packages the vue project
  • Detailed explanation of VSCode configuration to start Vue project
  • Simple configuration method for hot start debugging of webpack+vue+express(hot)
  • Analysis of the reasons why vue-cli cannot access the local service LAN
  • Detailed explanation of vue express starting data service
  • Vue implements the product tab of the product details page function
  • Vue implements the countdown component for second kills
  • Detailed explanation of the implementation principle of Vue2.0/3.0 two-way data binding
  • How to start a Vue.js project

<<:  Introduction to Nginx log management

>>:  Detailed explanation of MySQL using profile to analyze slow SQL (group left join is more efficient than subquery)

Recommend

Steps to enable TLS in Docker for secure configuration

Preface I had previously enabled Docker's 237...

WeChat Mini Program video barrage position random

This article shares the specific code for randomi...

Summary of several key points about mysql init_connect

The role of init_connect init_connect is usually ...

Vue implements scroll loading table

Table of contents Achieve results Rolling load kn...

HTTP and HTTP Collaboration Web Server Access Flow Diagram

A web server can build multiple web sites with in...

XHTML no longer uses some obsolete elements in HTML

When we do CSS web page layout, we all know that i...

About uniApp editor WeChat sliding problem

The uniapp applet will have a similar drop-down p...

Summary of events that browsers can register

Html event list General Events: onClick HTML: Mous...

How to create a project with WeChat Mini Program using typescript

Create a project Create a project in WeChat Devel...

mysql installer web community 5.7.21.0.msi installation graphic tutorial

This article example shares the specific code for...

MySQL 5.7.15 version installation and configuration method graphic tutorial

This article shares with you a detailed tutorial ...

Solution to the Multiple primary key defined error in MySQL

There are two ways to create a primary key: creat...

MySQL 5.7.23 version installation tutorial and configuration method

It took me three hours to install MySQL myself. E...

Mysql | Detailed explanation of fuzzy query using wildcards (like,%,_)

Wildcard categories: %Percent wildcard: indicates...