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

Implementation of Vue top tags browsing history

Table of contents nonsense Functions implemented ...

js to achieve star flash effects

This article example shares the specific code of ...

Details of the order in which MySQL reads my.cnf

Table of contents The order in which MySQL reads ...

JavaScript to achieve simple drag effect

This article shares the specific code of JavaScri...

Vue Router loads different components according to background data

Table of contents Requirements encountered in act...

Share a Markdown editor based on Ace

I think editors are divided into two categories, ...

Ideas and codes for realizing magnifying glass effect in js

This article example shares the specific code of ...

One-click installation of MySQL 5.7 and password policy modification method

1. One-click installation of Mysql script [root@u...

Detailed explanation of the platform bus of Linux driver

Table of contents 1. Introduction to platform bus...

JavaScript to implement retractable secondary menu

The specific code for implementing the retractabl...

mysql is not an internal command error solution

The error "mysql is not an internal command&...