Re: Retain Spaces in field value




AJ wrote:
Morning,

I have a value I'm trying to pass from a form in a cookie. The first
time it's passed it shows up as "North Hall A" but when a user is sent
back to the page the value changes to "North"

I set the cookie like:

my $cookie_id = Table


my $cookie = cookie(-name => 'Building',
-value => $cgi->param('Building'),
-expires => '+3d');

and then reference it like $cookie_id.

eh?

That doesn't make sense. The variable $cookie_id above has nothing to
so with any cookies. Please decide which CGI.pm API you are using and
stick with it.

Please produce a _minimal_ but _complete_ script (with warnings and
strictures enabled) that you've actually run and observed to display
the symptoms you describe. Post the script verbatim (copy+paste, do
not retype).

In PHP I know I can use
urlencode to preserve the spaces but I can't find out how perl does it.

I think you mean Perl, not perl. How Perl does what? URL
encoding/decoding? There are modules on CPAN to do that but it's only
actually one line of code. The code can be found in the FAQ "How do I
decode or create those %-encodings on the web?"

But CGI::cookie's -value parameter doesn't need encoding.

.



Relevant Pages

  • Retain Spaces in field value
    ... I have a value I'm trying to pass from a form in a cookie. ... time it's passed it shows up as "North Hall A" but when a user is sent ... urlencode to preserve the spaces but I can't find out how perl does it. ...
    (perl.beginners)
  • RE: IkonBoard v3.1.1: arbitrary command execution
    ... Subject: IkonBoard v3.1.1: arbitrary command execution ... There is a flaw in the Perl code that cleans up user input before ... allowing an attacker to evaluate arbitrary Perl and hence run arbitrary ... The flaw is in the code that cleans up the value of the 'lang' cookie, ...
    (Vuln-Dev)
  • IkonBoard v3.1.1: arbitrary command execution
    ... Vendor Fix: None available ... IkonBoard is a comprehensive web bulletin board ... There is a flaw in the Perl code that cleans up user input before ... The flaw is in the code that cleans up the value of the 'lang' cookie, ...
    (Bugtraq)
  • Re: Unix filename conversion app?
    ... > You can even view the Perl source code on that site and knock up ... content into a format that can readily be pasted back into the Web ... (Does anyone know what format 'wget' expects cookie ... converting from an existing browser?) ...
    (comp.sys.acorn.apps)
  • Re: [PHP] Cookie Trouble: getting the information back out...
    ... for ASP, Perl, I suspect Java and most other languages. ... There might be a language that sets a cookie when you assign a value ... Unless I was doing something differently when I originally wrote this in PERL I don't recall having this issue. ...
    (php.general)