WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How to

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Use Cookies

Keywords: cookie WebDatData  dumpinputdata 

Question:

How do you use webbatch to read and set cookies from the client?

Answer:

Setting Cookies

Cookies are set in the header portion of a html page returned to the user.
	WebOut('Content-type: text/html', 1)  ; Note only 1 LF here
        WebOut('Set-Cookie: useridcode=Fred;',2) ; Note 2 LF's here to stop header
	WebOutFile('c:\home\some.html')
The above code will set a cookie "useridcode" to value "Fred"

Reading Cookies

Do a:
http://your.computer.com/webcgi/webbatch.exe?dumpinputdata 
and see how it shows up there. Then a WebDatData ought to be able to pick it up.

Using the example above


   useridcode=WebDatData("useridcode")
Should return the value "Fred"

The WebBatch website is created using weber files and has some examples of how they work (see the "how was this done" button).


Article ID:   W12477
Filename:   How to use Cookies.txt
File Created: 2011:06:07:08:14:00
Last Updated: 2011:06:07:08:14:00