5 my $link = $self_url. '?'. $cgi->query_string;
7 which will fail when the query string exceeds ~2k (browser-dependent)
12 my $query = $m->scomp('/elements/create_uri_query');
13 my $link = $self_url. '?'. $query;
15 You can also pass an optional 'secure'=>1 parameter to force handling as
16 session data, even for short query strings.
19 See also handle_uri_query which needs to be used by the target page.
29 foreach my $param (grep /pay(info\d?|cvv)$/, $cgi->param) {
30 my $value = $cgi->param($param);
31 next unless length($value);
32 my $encrypted = FS::Record->encrypt( $value );
33 $cgi->param($param, $encrypted);
38 my $query = $opt{query} || $cgi->query_string;
40 if ( length($query) > 1920 || $opt{secure} ) { #stupid IE 2083 URL limit
42 my $session = int(rand(4294967296)); #XXX
43 my $pref = new FS::access_user_pref({
44 'usernum' => $FS::CurrentUser::CurrentUser->usernum,
45 'prefname' => "redirect$session",
46 'prefvalue' => $query,
47 'expiration' => time + ( $opt{secure} ? 120 #2m?
51 local($FS::Record::no_history) = 1;
53 my $pref_error = $pref->insert;
55 die "FATAL: couldn't even set redirect cookie: $pref_error".
56 " attempting to set redirect$session to $query\n";
59 $query = "redirect=$session";