Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
TypeError: Cannot read properties of undefined (reading 'session')

I'm trying to set up some cookies for my electron application but when the code on the function below executes, this error comes out TypeError: Cannot read properties of undefined (reading 'session').

const { session } = require("electron")    

function updatePatient(id) {
    session.defaultSession.cookies.set({url: './', name: 'patientId', value: id})
    ipcRenderer.send('updatePatientWindow')
}  

updatePatient(id)

I also tried to use

const { electron } = require('electron')
electron.session.defaultSession.cookies.set({url: './', name: 'patientId', value: id})

but that doesn't work either

Edit:

Seems like session works only on the main process. A workaround is to use ipcRenderer there to set and read cookies.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!