Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6947249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:40:12+00:00 2026-05-27T13:40:12+00:00

Cross-site request forgery is common on web now a days. I am facing this

  • 0

Cross-site request forgery is common on web now a days. I am facing this in my own site deployed on Google App engine. I got to know this by examining access logs. Is there any XSRF/CSRF library or other solution available for App engine that I can use. And, how much load it will add to my site?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:40:12+00:00Added an answer on May 27, 2026 at 1:40 pm

    I use this code called from basehandler’s init request function

    def init_csrf(self):
        """Issue and handle CSRF token as necessary"""
    
        self.csrf_token = self.request.cookies.get('c')
        if not self.csrf_token:
            self.csrf_token = str(uuid4())[:8]
            self.set_cookie('c', self.csrf_token)
        if self.request.method == 'POST' and self.csrf_protect \
            and self.csrf_token != self.request.get('_csrf_token'):
            raise CsrfException('Missing or invalid CSRF token.')
    

    I took it from Facebook’s example canvas application includes code to handle crsf. I did not practically test it much but I include it in my project since I have a canvas application for Facebook that runs in FB as an iframe. It makes every request handler have an instance variable that you can set to false if it generates an exception for normal cases.

    I didn’t yet test it thoroughly but this is the material I have about CRSF tokens for Google App Engine in python. If you like to check out the details exacly how I’m learning how to use it these days you may clone my repository.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Cross-site request forgery (CSRF or XSRF) attacks provokes unauthorised actions in your web application
Regarding cross-site request forgery (CSRF) attacks, if cookies are most used authentication method, why
So, I'm trying to make cross-site AJAX request from my own script to the
Is checking the referrer enough to protect against a cross site request forgery attack?
I my recent Django-project I use mako templates. About Cross Site Request Forgery CSRF.
We have an ASP.NET web forms application that is probably vulnerable to Cross-site request
I'd like to protect my site against cross-site request forgery . I'm trying to
Is there any in-framework way to prevent Cross Site Request Forgery (CSRF) within ASP
How do you get around this Ajax cross site scripting problem on FireFox 3?
Is this regular expression enough to catch all cross site scripting attempts when embedding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.