Create cookie : Cookie « CGI « Perl

Home
Perl
1.Array
2.CGI
3.Class
4.Data Type
5.Database
6.File
7.GUI
8.Hash
9.Language Basics
10.Network
11.Regular Expression
12.Report
13.Statement
14.String
15.Subroutine
16.System Functions
17.Win32
18.XML
Perl » CGI » Cookie 




Create cookie
    

use CGI;

$q1 = new CGI;

$cookie1 = $q1->cookie(
       -name=>'FIRST_NAME', -value=>'Joe',
       -expires=>'Fri, 30-Aug-2002 15:30:30 GMT;',
       -path=>'/',
       -domain=>'127.0.0.1');

print $q1->header(-cookie=>$cookie1);

print "Cookie Created ...";

   
    
    
    
  














Related examples in the same category
1.A Simple Cookie Example
2.A Simple Cookie Example Using the CGI Module
3.Retrieving Cookies
4.Setting Cookie Expiration Without Using the CGI Module
5.Setting Cookie Expiration Using the CGI Module
6.Sending Multiple Cookies Using CGI.pm
7.Retrieving Multiple Cookies
8.Cookies and Session Tracking
9.Session tracking in our CGI scripts
10.Read cookie value
11.Program to read cookies from the client's computer
12.Time Period Abbreviations for the CGI Module's Header and Cookie Functions
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.