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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:03:07+00:00 2026-06-01T02:03:07+00:00

im working on a simple C++ HTTP server as a school project and I

  • 0

im working on a simple C++ HTTP server as a school project and I would like to add php support for it. Post and Get methods should not be a problem, but Im stuck on a cookies. I googled for long and couldnt find, how php handles cookies, where it gives the output for http server such as Apache or how does it work in global.
Any ideas how I could print this code:

<?php
setcookie("cookie[three]","cookiethree");
?>

to console so it can be read by my server and after some parsing(?) sent to a client?

Thanks guys

EDIT:
This is really close example to what I need, but when I execute the script it shows empty array..
http://php.net/manual/en/function.headers-list.php

php version:
PHP 5.3.6-13ubuntu3.2 with Suhosin-Patch (cli) (built: Oct 13 2011 23:09:42)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

  • 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-01T02:03:08+00:00Added an answer on June 1, 2026 at 2:03 am

    PHP get its superglobals variables (such as Cookies) from the HTTP server itself. When you parse a client request, you must store every key/value pair in an appropriate container (an HTTPRequest class perhaps).

    When interfacing your server with PHP you should write a module like apache does (mod_php). To do this, you will have to write your own API for interfacing with the modules. This means for every module you’ll have (php, python …) you will have the same interface for your Inputs/Outputs.

    When writing such an API, you should define an easy way to pass all the superglobals variables PHP needs from the server. I’ve written my own HTTP server for the same purpose and the documentation of PHP is a little tricky about this point but you can inspire yourself from PHP-CGI : there is a php.exe or simply php command on Linux/Windows which can take arguments such as variables if my memory is good. Anyway, there are several ways to pass these arguments to php and I used CGI for my server.

    Hope that’ll help you.

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

Sidebar

Related Questions

I'm working with my simple PHP captcha algorithm ( http://www.source.ofitall.com/devel/captcha.php ) and I have
A very good morning, i am currently working on a simple php project, the
I am working on creating a simple HTTP server as part of a Java
I am working with the sample Home application project on http://developer.android.com/resources/samples/Home/index.html I've added another
I'm looking for good/working/simple to use PHP code for parsing raw email into parts.
To learn c++11 (and boost) I am writing a simple http-server using boost asio
I'm working on a simple demo project so that I can learn some things
I'm a novice/beginner programmer having problems getting some simple client/server C code working. My
I have a simple PHP file which loads a file from my server, base64
Actually I'm working on very simple FTP server. Now I have problem with sending

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.