vue-cookie | A Vue.js plugin for manipulating cookies | Plugin library
kandi X-RAY | vue-cookie Summary
kandi X-RAY | vue-cookie Summary
A Vue.js plugin for manipulating cookies
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- for testing
- get the module name
- set a value
- Generate a cookie header
vue-cookie Key Features
vue-cookie Examples and Code Snippets
Community Discussions
Trending Discussions on vue-cookie
QUESTION
I have a login page that I can login via google, and when I login I get the parameters of the user. The problem is when I refresh the page the parameters are not saved.
This is my code:
...ANSWER
Answered 2021-Oct-05 at 20:23I think you skipped this line: https://github.com/alfhen/vue-cookie#installation
Or do it the cool way and load it in your main.js/app.js
You should register that VueCookie
plugin in the file where you start the Vue instance.
QUESTION
I'm trying to code in Vue js a text which changes it's color on a click and saves it's state in a cookie. It works good on the first visit (no cookie), color is changing properly, but after refreshing color always turns green. I thought there's a problem with cookie, so I displayed it's value (true/false) in a different and it's working properly. Only color doesn't work.
I've used that cookie library -> https://www.npmjs.com/package/vue-cookies
Video with the problem -> https://streamable.com/ky2l1z
...ANSWER
Answered 2021-Sep-15 at 19:35Try parsing the string value to Boolean using JSON:
QUESTION
I have middleware which gets data from cookie (I use vue-cookies
).
ANSWER
Answered 2021-Aug-05 at 11:06Ok, to get access to this field I just used req.cookies.region
Thanks for help everyone!
QUESTION
The command used : sudo npm install I am trying to execute this command inside the a specific folder.
The package.json file is as shown:
...ANSWER
Answered 2021-May-20 at 12:19After spending quite some time on this issue, the solution that worked for us was that "node-sass" was not yet compatible with node v16. Hence, after downgrading node version from v16 to v14, and downgrading npm from v7 to v6, it worked.
QUESTION
I'm having issue running my nuxt app. When I do npm run dev I get this error: Module build failed (from ./node_modules/eslint-loader/dist/cjs.js): Error: Cannot find module 'eslint'.
I have tried clearing my cache, npm install and running again but didn't solve my issue. This is my package.json:
ANSWER
Answered 2021-Apr-06 at 02:31It looks like eslint
is missing from your dependencies. Install it as a devDependency
:
QUESTION
I'm making a login application with Login
and ResetPassword
components. Currently, my Login
component displays correctly. However, when I try to go to my /reset-password
route, it only shows my Login
component. I cannot get the content of my ResetPassword
component to display no matter what I do. Am I missing something?
The structure of my src
directory (minus assets and shims`:
ANSWER
Answered 2021-Apr-02 at 19:18You should use router-view
component to render the current route component instead of
App.vue
QUESTION
I want to manage cookies in the browser and use this external plugin vue-cookies.
But if I call its method in some vue file as this.$cookies.get(...) I get an error in the browser:
TypeError: Cannot set property '$cookies' of undefined
Here is my code. Main.js
...ANSWER
Answered 2021-Mar-11 at 06:40As of v1.7.4, vue-cookies
only works with Vue 2.
Vue 3 requires vue3-cookies
instead:
QUESTION
I've been working on my first Vue project and had to figure out a way to keep the user's login "state" since the back-end is stateless (jwt
). I've figured to keep this state in a cookie, which I store using the vue-cookies
plugin. So i set it like so
cookies.set("isUserLoggedIn", true, "infinite");
.
I then put it in a computed property, so the view of the application would be rerendered
ANSWER
Answered 2020-Dec-08 at 21:21By default, cookies are not reactive. You can make them reactive though with the help of some lib like that one. It's allowing you to use cookies as computed properties or to watch cookies for changes made by a request
QUESTION
I have a Vue.js project deployed on firebase and a node-express app deployed on Heroku. Now I want to send cookies along with each request to the server using Axios. I am using Axios and cookies are being set using vue-cookies (which are of sameSite: none
and secure: true
attributes).
In localhost, I can see the cookies in each request in my backend and can access them using req.cookies.session
. (The session is my cookie name that is saved on the client-side.)
But in production, I can't see the cookies in the request. What am I doing wrong?
node-express cors
...ANSWER
Answered 2020-Dec-03 at 07:29Try this
If you are using Firebase Hosting + Cloud Functions, __session is the only cookie you can store, by design. This is necessary for us to be able to efficiently cache content on the CDN -- we strip all cookies from the request other than __session. This should be documented but doesn't appear to be (oops!). We'll update documentation to reflect this limitation.
Also, you need to set Cache-Control Header as private
res.setHeader('Cache-Control', 'private');
QUESTION
I am using vue-cookies for my vue.js project. I am setting the cookie from
...ANSWER
Answered 2020-Dec-01 at 19:43This is likely happening because you are attempting to set a secure cookie in the dev environment under http://
, which is insecure.
From the MDN docs on secure cookies:
Note that insecure sites (http:) can't set cookies with the Secure directive.
You can try to test this on a secure server or run Vue CLI in secure mode. To do that, add the following to vue.config.js in your project root:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-cookie
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page