Archive: Creating a cookie


Creating a cookie
I wanted to create a cookie while installing the software.This cookie will contain the version number of the Software being installed.

Does anyone knows how to do that ?

Thanks
Neeraj


Can you just create a INI file with the info? ;)


I think the best solution is to open a site that sets the cookie.


The problem is that I have to set the cookie on User's machine when he installs the software.
It's not through website .I do have an html help page which i show after the User has successfully installed the software.
But its an offline User guide .

I am not sure how I can do that .
Does anyone has tried this before ?

Thanks
Neeraj


Lunar,

The problem is that the cookie will be used by some of our websites.
So I don't think the ini file will serve the purpose :(


Verburg,

What do you mean by opening a site ?
Do you want me to open some website for that purpose :((


Originally posted by Neeraj Tewari
What do you mean by opening a site ?
Do you want me to open some website for that purpose :((
Yes, I think he means that. Cookies are normally only used when visiting websites. So it would be logical to use a webbrowser session to set the cookie. Afterall, you don't know which browser the user uses, so even if you succeed in adding cookie-support to your installer it's likely to work only for some browsers. Netscape and Internet Explorer use a different way of storing cookies, so there's no general rule for creating cookies.

I don't know why you want to use the cookie, but I assume it's for registration purposes? Well, then you can let the installer visit a website after a succesful installation. Just pass the values you want stored in a cookie in the URL. Example:

http://my.server.com/registration.php?email=tom@internet.com&serial=1234456

Make sure this PHP-page sets the cookie you want.

You can even use an offline page with JavaScript.