CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Log in only once



May 23, 2001, 4:58 PM

Post #1 of 2 (1324 views)
Log in only once Can't Post

Hi there,
See I am building an advanced (i think so:)) forum for myself (something like ubb) and I have one problem.
What do you do so that user has only to log in once in your system. Uhhh...if you don't undersand my english just take a look around. Like on this forum you can log in and then post answers, topics, send message etc.
Or another example can be found on anandtech foums
Again, I don't ask for the code (though it would help me :)), I just want to undersand how it works (or lets say to check if i am right)

Thank you,
Any help will surely be appreciated

What is difficlut takes time, what is impossible takes a little longer


May 23, 2001, 5:47 PM

Post #2 of 2 (1321 views)
Re: Log in only once [In reply to] Can't Post

You can set a cookie to store some data on the user's machine, then retrieve the info you need to auto log them in.

Check out CGI::Cookie in the docs.

Here's some code, but you'll need to adjust it for your own use.

Set a cookie...

my $cookie = new CGI::Cookie(-name=>'foo', 

print "Set-Cookie: $cookie\n";

To verify...

if(my %cookies = fetch CGI::Cookie){ 
if( defined($cookies{'foo'}) ){
my $cookie_val = $cookies{'foo'}->value;
...use your $cookie_val...

The biggest pain will be sorting out your browser text/html header.



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives