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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:03:24+00:00 2026-05-18T10:03:24+00:00

When user is on the page you can use session or cookies to check

  • 0

When user is on the page you can use session or cookies to check who is he.

But when AJAX is used, for example, for sending an answer, sending page have no contact with user. How can it check is it real registered user, or just spambot sending this by headers?

What is the common practice for AJAX user validation?

  • 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-18T10:03:25+00:00Added an answer on May 18, 2026 at 10:03 am

    AJAX requests contain the same cookies like regular requests. Besides that you can send any arguments like session IDs with the AJAX request.

    Actually, for the server it makes absolutely no difference if a request is made through an XmlHttpRequest object or not. Most frameworks add an X-Requested-With: XMLHttpRequest header though but that’s completely optional.

    So.. whatever means you use to pass your session data, simply ensure it’s also available to the script called with your AJAX request:

    • If you have a session id passed via GET/POST, include it in your request’s arguments.
    • If cookies are needed, ensure they are send to the file. If it’s in the same folder like the current file or a descendant of it you are usually safe. If it’s on another (sub-)domain you might get problems – not only with cookies but alsowith cross-domain AJAX which usually isn’t allowed due to the same-origin policy browsers have.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use cookies to check the user..but if someone kidnaps the cookie data, then
I can post on group / page and user wall, but i don't want
I have a page where a user can import data to the site. either
I have a page where the user can dynamically add file upload boxes. Adding
I have a page where the user can edit various content using buttons and
We have a page of search results which the user can hit in several
Here is jsfiddle ! I am trying to make user page where he can
Datatable on the page can be filtered by user input. Entered string is received
I want to write a page where user's can write a blog post and
I am creating a page where people can post articles. When the user posts

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.