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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:03:48+00:00 2026-05-21T04:03:48+00:00

Is it OK to send cookie headers directly with header() calls? I am tinkering

  • 0

Is it OK to send cookie headers directly with header() calls?

I am tinkering with http cookie mechanism in PHP and would like (at least initially) to try the “raw” thing 🙂

The Brad Christie’s answer to “php-how-to-stringify-array-and-store-in-cookie” assumes it is, but is there a somehow official source on the topic (or is it at least a well-known practice)?

Thanks in advance for clarifying the topic.

[EDIT: AN IMPORTANT NOTICE]

An interesting thing I have discovered is that calling header('Set-Cookie: ...'); effectively prevents any cookies previously supplied with setcookie('...'); from being sent, at least on my machine (PHP 5.3.5, Apache 2.2.17, WinXP SP2). Whether this is a feature / bug(?) or a consequence of PHP semantics/rules violation, I don’t know.

Analyzing PHP .c sources will possibly bring an answer (one should posibly look into head.c (header(), setcookie(), etc) and mod_php5.c (Apache module) files for that).

  • 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-21T04:03:49+00:00Added an answer on May 21, 2026 at 4:03 am

    IT IS NOT

    Please see the “edit” part of the question.

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

Sidebar

Related Questions

I need to send more than a Set-Cookie HTTP header using HttpWebRequest class. Problem
I get this: Warning: session_start(): Cannot send session cookie - headers already sent by
I need to send hundreds of newsletters, but would like to check first if
I would like to know if there is a way to prevent PHP from
How do I send the Set-Cookie header when working with a BaseHTTPServerRequestHandler , and
To send a serial string character to the serial port. I would need to
The example on PHP manual shows how you can use stream contexts to send
I would like to separate my source folders into two: The folders that contain
Possible Duplicate: php headers already sent error I have attached my code which am
Possible Duplicates: PHP headers already sent PHP session_start() error? What does this error mean?

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.