I'm having trouble retrieving the sessionid while using vue-cookies

Attempting to retrieve the sessionid from a cookie using vue-cookies.

After importing vue-cookies, I checked and printed the cookies:

import VueCookies from 'vue-cookies';
Vue.use(VueCookies);
console.log(Vue.cookies.keys());

Despite seeing both keys (csrftoken and sessionid) in Chrome's application under Storage --> Cookies, only ["csrftoken"] is displayed after logging in.

Wondering why I am unable to retrieve the sessionid with Vue.cookies.keys(). Any insights would be appreciated.
Thank you for your assistance.

Answer №1

I was facing an issue with the Django session where the default setting for 'httponly' was True. However, after changing it to False in the settings.py file, the problem got resolved.

Here is the code snippet from django setting.py:

SESSION_COOKIE_HTTPONLY = False

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When a non-empty variable is assigned to the v-model, the checkbox will be checked automatically

Here is the code snippet for updating user-submitted data in a form: <div class="myLabel">Repeat on: </div> {{ data.repeatOn }} <div class="myInput"> <input type="checkbox" id="1" value="1" v-model="data.repeatOn" :checked="data.re ...

Check out the ViewUI Vue.js component that expands to reveal more content!

Is there a simple component to create the expand/collapse button with a blur effect like in all the demos? I see it used across different variations of the demos and am wondering if there is a specific component or demo showcasing how to achieve this effec ...

Display a date that is asynchronously rendered for each item in the v-for loop

I am currently working on a project that involves an array of servers being displayed in a template using v-for. To receive dynamic data for each server, I have implemented the vue-nats library to subscribe them individually. methods: { subscribe(uuid) ...

I'm struggling to figure out the best method for updating data properties in Vue. Computed properties and watchers aren't getting the job done. What

I'm facing a challenge with updating certain input fields on a form I'm currently working on. After receiving data from axios in one data property, I am attempting to prefill some fields with the response. There are four fields returned from the ...

Learn how to access the checkbox event.target.checked and event.target.value properties in Vuetify

How can I retrieve the checked status and value of a Vuetify checkbox using event.target.checked and event.target.value? In my application, I am utilizing Vuetify's checkbox component. When the user interacts with the checkbox by checking or unchecki ...

What is the best way to retrieve component data within the mapState() function?

When the prop buttonType has a certain value, I need to access different store variables: ...mapState({ backgroundColor: state => this.buttonType === 'primary' ? state.primary_button.background_color : state.secondary_button.backgrou ...

Troubleshooting Vue component reactivity problems with async server requests

Providing some background information: Within my Vue application, I have a view called Articles. Upon mounting this component to the DOM, I use the axios library to fetch all posts from the database through Laravel controllers and API routes. In the articl ...

Determining when props are updated in Vue.js 2 when passing an object as a prop

Let's say there is an array feedsArray, with a sample value like this: this.feedsArray = [ { id: 1, type: 'Comment', value: 'How are you today ?' }, { id: 2, type: 'Meet', name: 'Daily ...

A guide to integrating OIDC through the vuex-oidc library within a Vue.js application

We are currently working on incorporating OIDC for user onboarding from our primary platform to our secondary platform When attempting to call the AutomaticSilentRenew function, we encounter the following error: Could there be something incorrect here? (Pl ...

Troubleshooting Incorrect Background Image Paths in Vue Component CSS

output output: { path: config.build.assetsRoot, publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, filename: '[name].js' } base ...

Can we access local storage within the middleware of an SSR Nuxt application?

My Nuxt app includes this middleware function: middleware(context) { const token = context.route.query.token; if (!token) { const result = await context.$api.campaignNewShare.createNewShare(); context.redirect({'name': &a ...

Creating a custom directory structure for specific types of files in Vue Cli 3 build

Recently, I started using Vue to create web applications. When I use npm run build, it generates the following structure: https://i.stack.imgur.com/RWp4H.png However, I have a specific layout in mind that I want to achieve: https://i.stack.imgur.com/79S ...

Exploring the functionality of publicRuntimeConfig in Nuxt plugins

I have developed a new Vue socket.io plugin called @/plugins/socket-io.js import Vue from 'vue' import VueSocketIO from 'vue-socket.io' Vue.use( new VueSocketIO({ debug: true, connection: process.env.SOCKET_IO_CONNECTION, } ...

Is it possible to modify content in a Laravel post using formData?

Working on a social network, I encountered an issue when trying to enable post editing. The error message displayed is: message: "This action is unauthorized." Despite following the flow of sending data through Axios calls and defined routes to the contr ...

Using an external script to modify or call a Vue.js method

My Vue app is constructed using Webpack and includes a few basic computed properties, such as calculating the sum amount from input values. However, I now require the capability to replace the summation function with one stored in a separate file that is n ...

Experiencing difficulties when attempting to send a cookie to the server

Why is the vue+axios frontend not sending cookies to my php server in the request header? I am currently in the process of migrating an old project to a new server. After making some optimizations to the project architecture, everything worked perfectly f ...

`Make Bootstrap 5 Modal centered horizontally`

I'm facing an issue with my Vue application where the Bootstrap 5 modal is not horizontally centered on desktop. Below is the code snippet of my component: Modal.vue <template> <teleport to="#modal-container"> <div ...

Bidirectional Data Binding with Computed Setter in Vue.js

Exploring the concept of two-way data binding with a basic example: <template> <input v-model="fullname"/> <input v-model="first"/> <input v-model="last"/> </template> <script> var app = new Vue({ el: '#a ...

The Vue framework patiently anticipates the arrival of data from props before proceeding with

I am facing a recurring problem where I need to retrieve data from a prop before performing certain actions within the created hook. This leads to errors such as "this.value is not defined" because the prop data has not yet loaded. To remedy this, I have ...

Issues with Vue js not updating the DOM

I am currently working with multiple components: A, B, and C. In component A, there is an array that plays a crucial role in the flow of data. When an item is selected in component A: An emit event triggers a method in component B that displays the lengt ...