File: test_cookie.adb

package info (click to toggle)
adacgi 1.6-9
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 280 kB
  • ctags: 21
  • sloc: ada: 1,068; makefile: 86
file content (25 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- This is a short program to test getting cookie values.

with Ada.Text_Io; use Ada.Text_Io;
with Ada.Integer_Text_Io; use Ada.Integer_Text_IO;
with CGI; use CGI;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

procedure Test_Cookie is 
  Temp: Unbounded_String;
begin
  Put("Number of cookies=");
  Put(Cookie_Count);
  New_Line;

  if Cookie_Count > 0 then
    Temp := Cookie_Value(1);
    Put("Value of first cookie: ");
    Put_Line(To_String(Temp));
  end if;

  Temp := Cookie_Value("problem");
  Put("Value of cookie ""problem"": "); 
  Put(To_String(Temp));
end Test_Cookie;