Name

set-cookie — sets browser cookie

ATTRIBUTES

Attribute Pos. Req. Default Description
name Yes name of the cookie
value Yes value of the cookie
expire Yes
domain Yes
path Yes
secure Yes 0 cookie is sent only over SSL connections
interpolate     0 interpolate output?
hide     0 Hide the tag return value?

DESCRIPTION

BEHAVIOR

This tag does not appear to be affected by, or affect, the rest of Interchange.

EXAMPLES

No examples are available at this time. We do consider this a problem and will try to supply some.

NOTES

AVAILABILITY

set-cookie is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: code/SystemTag/set_cookie.coretag
Lines: 12


# Copyright 2002-2008 Interchange Development Group and others
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.
# 
# $Id: set_cookie.coretag,v 1.7 2008-09-13 04:28:56 jon Exp $

UserTag set-cookie          Order        name value expire domain path secure
UserTag set-cookie          Version      $Revision: 1.7 $
UserTag set-cookie          MapRoutine   Vend::Util::set_cookie

Source: lib/Vend/Util.pm
Lines: 2091

sub set_cookie {
  my ($name, $value, $expire, $domain, $path, $secure) = @_;

  # Set expire to now + some time if expire string is something like
  # "30 days" or "7 weeks" or even "60 minutes"
if($expire =~ /^\s*\d+[\s\0]*[A-Za-z]\S*\s*$/) {
    $expire = adjust_time($expire);
}

if (! $::Instance->{Cookies}) {
  $::Instance->{Cookies} = []
}
else {
  @{$::Instance->{Cookies}} =
    grep $_->[0] ne $name, @{$::Instance->{Cookies}};
}
  push @{$::Instance->{Cookies}}, [$name, $value, $expire, $domain, $path, $secure];
  return;
}

AUTHORS

Interchange Development Group

SEE ALSO

read-cookie(7ic)

DocBook! Interchange!