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

  • Home
  • SEARCH
  • 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 8435003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:48:48+00:00 2026-06-10T06:48:48+00:00

Between most strong CSRF protection, there is the form token protection. The question I

  • 0

Between most strong CSRF protection, there is the form token protection. The question I have about this method, is about usability: if a user opens multiple page containing a form, which use the token, are generated multiple token, but only the last opened page can successful send the form, all the other will give error.

I thought 2 solutions:

  1. Keep a unique token for all the duration of session.
  2. Store all generated tokens in session.

But:

  1. This is the more realistic solution, but is less safe.
  2. This generate a large resource overhead, because a user could open many pages, and I must store all the generated token.

Therefore, how have you solved this question?

PS The website I’m developing, is practically a ecommerce in PHP and although the money transfer will be managed through an external provider (like paypal), I think right give a good safety to my service.

  • 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-06-10T06:48:49+00:00Added an answer on June 10, 2026 at 6:48 am

    You don’t need to store tokens in the database.

    Instead, you should include the same token in a cookie; a cross-site attacker cannot read or set cookies.
    As long as the you get the same token in the cookie as the POSTed form, you’re safe.

    For additional security, you can hash them with a keyed HMAC hash, and verify that hash to make sure that the token came from your server.
    You can also make the tokens per-user.

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

Sidebar

Related Questions

I've read about the difference between double precision and single precision. However, in most
I hope this question is appropriate for stackoverflow... What is the difference between storing
Stackoverflow User Luke wrote in this answer : The boundaries between desktop and web
What is the most standard or best way to persist data between requests? Should
What is the most efficient to share data between multiple cores. Sure you can
Simply put: What is the most effective way to share / reuse code between
What is the difference between -XX:+UseParallelGC and -XX:-UseParallelGC? Most links indicate the first, but
In R, what is the most efficient way to count the length between 2
Between Windows XP and Vista (and server 2003 and 2008) Microsoft have removed the
Lot of questions has been already asked about the differences between string and string

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.