Using windows forms, is it possible to write cookies?

Posted on 2012-09-10
Last Modified: 2012-09-25
Is it it possible to use windows forms in to write to a cookie file, which can then be read by a php application?

What Id like is to run a executable which writes a cookie with a value (eg SessionID=randomString) to a particular domain (eg then on my webserver have a php file which is able to read the cookie and display it.

I already know how to read cookies with PHP, so I dont need help with that. I just need to figure out how to write a cookie value which that can be read by a browser.

Thanks in advance.
Question by:tonelm54
    1 Comment
    LVL 82

    Accepted Solution

    Cookies are written to a browser in the http response header from a web site.  And you seem to know that cookies can only be read on the domain that set them.  If your program is running as a web page on that domain, any cookies you set can be read by any other language on that domain.  You can set a cookie with ASP.NET and read it with PHP.

    This simple little PHP page will show all the cookies that are set for the domain that it comes from:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    <title>Cookie Dump</title>
    <h1>Cookie Dump</h1>
    echo "<br>&nbsp;<br>";

    Open in new window


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now