Results 1 to 3 of 3

Thread: how ?

  1. #1
    Join Date
    Mar 2004
    Location
    Malaysia
    Posts
    29

    Unhappy Unanswered: how ?

    how do i set cookies for login and password for web page, so that i can use them throughout all the web pages and cgi programs ?

  2. #2
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    167
    therefor you need the "cookie"-method of the CGI-module.

    you can do both set and get the cookies via this method!

    example:
    Code:
    my $query = CGI->new();
    my $cookie = $query->cookie(-name => 'The_Cookie_Name',
       -value=> 'e.g._SessionID',
       -domain => 'Your_Domain',
       -expires => '+3d'); # the cookie is three days valid
    
    print $query->header(-cookie => $cookie);
    board.perl-community.de - The German Perl-Community

  3. #3
    Join Date
    Mar 2004
    Location
    Malaysia
    Posts
    29

    but how ?

    Originally posted by reneeb
    therefor you need the "cookie"-method of the CGI-module.

    you can do both set and get the cookies via this method!

    example:
    Code:
    my $query = CGI->new();
    my $cookie = $query->cookie(-name => 'The_Cookie_Name',
       -value=> 'e.g._SessionID',
       -domain => 'Your_Domain',
       -expires => '+3d'); # the cookie is three days valid
    
    print $query->header(-cookie => $cookie);

    thx reneeb...but how do i take the user_id as reference throughout all the web pages ? for example: the user has to log into the system with his username and password and I need this username to be used throughout until he has logged out. which should I refer to in the cookie's code that u gave me ? like how to call the username within different web pages...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •