$Web Get Cookie Lstr: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:$Web_Get_Cookie_Lstr}} <span class="pageSubtitle"><section begin="desc" />Value of cookie to longstring<section end="desc" /></span> $Web_Get_Cookie retrieves the...") |
(Automatically generated page update) |
||
(24 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Web_Get_Cookie_Lstr}} | {{DISPLAYTITLE:$Web_Get_Cookie_Lstr}} | ||
<span class="pageSubtitle">< | <span class="pageSubtitle">Value of cookie to longstring</span> | ||
<var>$Web_Get_Cookie</var> retrieves the value of a cookie as a longstring. | |||
<var>$Web_Get_Cookie_Lstr</var> takes two arguments and returns a longstring or null for any error condition. | |||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%string</span> = <span class="literal">$Web_Get_Cookie_Lstr</span>( <span class="term">name</span>, <span class="term">occurrence</span> ) | ||
< | </p> | ||
===Syntax terms=== | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>name</th> | <tr><th>name</th> | ||
<td>The name of the cookie, returned by $Web_Cookie_Name. Required argument if occurrence is not specified, otherwise optional.</td></tr> | <td>The name of the cookie, returned by <var>$Web_Cookie_Name</var>. Required argument if occurrence is not specified, otherwise optional.</td></tr> | ||
<tr><th>occurrence</th> | <tr><th>occurrence</th> | ||
<td>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. | <td>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. | ||
</td></tr></table> | </td></tr></table> | ||
==Usage notes== | |||
<ul> | |||
<li><var>$Web_Get_Cookie_Lstr</var> returns the value of a cookie '''sent by the browser''' and is not affected by <var>$Web_Set_Cookie</var> or <var>$Web_Set_Cookie_Lstr</var> calls before the <var>$Web_Get_Cookie_Lstr</var> call. | |||
< | |||
</ | |||
For example, if a browser sent a cookie called "FOO" with a value of "PUB", in the following code | For example, if a browser sent a cookie called "FOO" with a value of "PUB", in the following code | ||
<p class="code"> %RC = $Web_Set_Cookie( 'FOO', 'BAR') | <p class="code"> %RC = $Web_Set_Cookie( 'FOO', 'BAR') | ||
Line 31: | Line 27: | ||
%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 | <li><var>$Web_Get_Cookie_Lstr</var> works pretty much like <var>$Web_Get_Cookie</var> or <var>$Web_Cookie_Parm</var> except | ||
<ul> | <ul> | ||
<li>It can return more than 255 bytes of data into a longstring. | <li>It can return more than 255 bytes of data into a longstring. | ||
<li>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. | <li>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. | ||
<li>It does not have position and length arguments (arguments 3 and 4). | <li>It does not have position and length arguments (arguments 3 and 4). | ||
</ul> | |||
</ul> | </ul> | ||
==Examples== | |||
This example places the value of each cookie into a <var class="product">User Language</var> LONGSTRING variable of the same name. | |||
<p class="code">%DESC = $Web_Get_Cookie_Lstr( 'DESC' ) | |||
%INFO = $Web_Get_Cookie_Lstr( 'INFO' ) | |||
</p> | |||
==See also== | |||
See also | |||
<ul> | <ul> | ||
<li>[[Janus Web Server application coding considerations#Understanding cookies|"Understanding cookies"]] | |||
<li>[[$Web_Set_Cookie_Lstr]] | <li><var>[[$Web_Set_Cookie_Lstr]]</var> | ||
<li>[[$Web_Cookie_Len]] | <li><var>[[$Web_Cookie_Len]]</var> | ||
<li>[[$Web_Cookie_Name]] | <li><var>[[$Web_Cookie_Name]]</var> | ||
<li>[[$Web_Num_Cookie]] | <li><var>[[$Web_Num_Cookie]]</var> | ||
<li>[[$Web_Set_Cookie]] | <li><var>[[$Web_Set_Cookie]]</var> | ||
< | |||
</ul> | </ul> | ||
[[Category:Janus Web Server $functions|$Web_Get_Cookie_Lstr]] | [[Category:Janus Web Server $functions|$Web_Get_Cookie_Lstr]] |
Latest revision as of 02:03, 16 April 2013
Value of cookie to longstring
$Web_Get_Cookie retrieves the value of a cookie as a longstring.
$Web_Get_Cookie_Lstr takes two arguments and returns a longstring or null for any error condition.
Syntax
%string = $Web_Get_Cookie_Lstr( name, occurrence )
Syntax terms
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. |
Usage notes
- $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).
Examples
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' )