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 7842883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:25:25+00:00 2026-06-02T16:25:25+00:00

Is it safe to use a signal auth-token in cookie for auth (post and

  • 0

Is it safe to use a signal auth-token in cookie for auth (post and requst only json via ajax)?

Why attacker can not get the form token in hidden field?

How an attacker do a CSRF attack with a POST request?

  • 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-02T16:25:27+00:00Added an answer on June 2, 2026 at 4:25 pm

    Is it safe to use a single token in a cookie for authentication?

    Sort of, if that cookie is HTTP-only (which helps protect against XSS) and SSL then there’s no way anyone outside your site can read that cookie.

    However, the user’s browser can retain that cookie, and will automatically send it whenever their browser requests a page from your application again. This is desired when the user is navigating your site, but also how a CSRF attack is possible.

    Why can’t the attacker get the form token in a hidden field?

    In a CSRF attack the hacker can’t actually read your site or the cookie because it should be protected by SSL/HTTPS. CSRF works by fooling your browser into sending their data along with your secure data to your site.

    So a value in a hidden field is part of the default defence against CSRF – they have a secret value in a cookie (which the hacker can fool the browser into re-sending but can’t see or edit) and the same value in a hidden input field in the encrypted page (which the hacker can’t get to). If the cookie and the hidden value don’t match then you have a CSRF attack.

    How does an attacker carry out a CSRF attack with a POST request?

    Ok, so suppose you have a secure website. You can log into this site using SSL and you’ll get an HTTP-only SSL authentication cookie back that keeps you logged in.

    Now I have a new page, on a completely different site. If I link to your site from mine then when you click on that link it will leave my site and go to yours, passing your cookie.

    If I add an HTML <form> to my page that POSTs back to your site the same thing happens: the browser goes back to your site and sends any data in the form, along with your cookie.

    Note that I haven’t read either your cookie or any pages on your site, as both are protected by SSL encryption.

    For the full effect I can hide that form on the page so that the user doesn’t even realise that they’re posting back to your site.

    A trivial example of this is the ‘Like’ functionality on Facebook – they’ve patched this now I think, but for a while I could fool your browser (without accessing your details) into sending your authentication cookie to the Facebook action that says you like something I want you to.

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

Sidebar

Related Questions

When I use safe mode (journaling only) on a batch insert on a sharded
Is it safe to use std::bind to pass a member function to boost::signals2::signal::connect()? In
When is it safe to use implicit casting? Use Case : I'm working with
Is it safe to use longjmp and setjmp in C++ on linux/gcc with regards
Is it safe to use such code? Response.Cookies[cookieName].Path = Request.ApplicationPath + /; I want
Is it safe to use the using statement on a (potentially) null object? Consider
Is the June 2009 WPF Toolkit safe to use in applications that will be
I'm wondering if it's safe to use requestAnimationFrame outside of experimenting yet? I guess
I would like to know if it is safe to use the following code
Though internal, I presumed that it is safe to use ConcurrentIdentityWeakKeyHashMap generally. However, the

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.