$Web Get Cookie Lstr: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Value of cookie to longstring<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Value of cookie to longstring<section end="desc" /></span>


$Web_Get_Cookie retrieves the value of a cookie as a longstring.
<var>$Web_Get_Cookie</var> retrieves the value of a cookie as a longstring.


==Syntax==
==Syntax==
Line 32: Line 32:
%FOO would be set to "PUB".  
%FOO would be set to "PUB".  


$Web_Get_Cookie_Lstr works pretty much like $Web_Get_Cookie or $Web_Cookie_Parm except
$Web_Get_Cookie_Lstr works pretty much like <var>$Web_Get_Cookie</var> or $Web_Cookie_Parm except
<ul>
<ul>



Revision as of 19:49, 15 June 2012

<section begin="desc" />Value of cookie to longstring<section end="desc" />

$Web_Get_Cookie retrieves the value of a cookie as a longstring.

Syntax

<section begin="syntax" /> %STRING = $Web_Get_Cookie_Lstr( name, occurrence ) <section end="syntax" />


$Web_Get_Cookie_Lstr takes two arguments and returns a longstring or null for any error condition.

name The name of the cookie, returned by $Web_Cookie_Name. Required argument if occurrence is not specified, otherwise optional.
occurrence The occurrence number of a cookie, or the occurrence number of the cookie matching name, if name is specified. Optional argument if name is specified, otherwise it is required.


This example places the value of each cookie into a User Language LONGSTRING variable of the same name.

%DESC = $Web_Get_Cookie_Lstr( 'DESC' ) %INFO = $Web_Get_Cookie_Lstr( 'INFO' )


$Web_Get_Cookie_Lstr returns the value of a cookie sent by the browser and is not affected by $Web_Set_Cookie or $Web_Set_Cookie_Lstr calls before the $Web_Get_Cookie_Lstr call. For example, if a browser sent a cookie called "FOO" with a value of "PUB", in the following code

%RC = $Web_Set_Cookie( 'FOO', 'BAR') %FOO = $Web_Get_Cookie_Lstr( 'FOO' )

%FOO would be set to "PUB".

$Web_Get_Cookie_Lstr works pretty much like $Web_Get_Cookie or $Web_Cookie_Parm except

  • It can return more than 255 bytes of data into a longstring.
  • It causes request cancellation if the result would be truncated on assignment to the target STRING %variable or as input to a STRING $function argument or subroutine parameter.
  • It does not have position and length arguments (arguments 3 and 4).


Longstrings and so $Web_Get_Cookie_Lstr are only available in Sirius Mods Version 6.2 and later. For more information about longstrings see the Sirius Functions Reference Manual.

See also