Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Help: want to set a ref cookie at signup page

Quote Reply
Help: want to set a ref cookie at signup page
Hi,

I am trying to set a cookie at the signup page to register where a user comes from but there must be a mistake in my way of trying it.
Modification to Login.pm:

Code:
...
elsif ($input->{signup_form}) {
my $ref = $IN->param('ref') || $IN->cookie($CFG->{user_cookie_prefix}.'ref') || "noref";
my $ref_cookie = $IN->cookie(
-name => $CFG->{user_cookie_prefix}.'ref',
-value => $ref,
-path => '/',
-domain => $CFG->{user_cookie_domain}
);
print $IN->header(-force => 1, -cookie => [$ref_cookie] );
print Links::SiteHTML::display ('signup_form',
{
Username => $IN->param('Username') || '',
Password => '',
Email => $IN->param('Email') || '',
refID => "$ref",
main_title_loop => Links::Build::build('title', Links::language('LINKS_SIGNUP'),
"$CFG->{db_cgi_url}/user.cgi?signup_form=1") });

Does anyone have an idea what I am doing wrong.

Thanks

n || i || k || o