Skip to content

What is ‘_xsrf argument missing from post’? Quick Fix

  • by
  • 2 min read

Python is one of the easiest programming languages to pick up and learn for complete beginners in 2022. However, that’s not to say that it isn’t powerful either. It’s one of the most popular and in-demand programming languages in the world right now. 

But every language comes with its own set of shortcomings and bugs that programmers have to deal with as they go along. In this article, we’re talking about the “_xsrf argument missing from post” error when using Jupyter with Python and telling you how to fix the problem. 

Also read: How to solve the Tower of Hanoi problem using Python?

Refresh the browser

Going back to /tree or the Jupyter homepage and refreshing the browser is a rather common fix for this error. In case you’ve already closed the homepage, enter the following command in the terminal to get the URL and login token.

jupyter notebook list

Once you have the link, just navigate to the homepage and refresh your browser. The error should now be resolved. 

Open another notebook on the same kernel

Several users have also reported that opening a new, non-running notebook on the existing kernel allowed them to sidestep the error and any notebooks which were giving the _xsrf error were saved without issues. Once again, if you’ve already closed the Jupyter homepage, you can get the URL to it by either going back to the terminal you used to launch it or using the aforementioned command.

Reconnect to the Jupyter kernel

If you’re on an older version of Jupyter, you can also resolve the error by clicking Kernel, shown on top of the notebooks followed by clicking Reconnect to resolve the error. This forces the currently running kernel to reconnect to any open notebooks resolving the error in the process. 

Also read: Is Python case sensitive when dealing with identifiers?

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: