Results 1 to 1 of 1

Thread: cookie getting and checking help **RESOLVED**

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2001
    Location
    Ottawa, Canada
    Posts
    181

    cookie getting and checking help **RESOLVED**

    i have

    Code:
    use CGI;
    $html = new CGI;
    
    my $loggedIn = 0;
    my $errMessage;
    my $madeCookie;
    %cookie = $html->cookie('StreamIt');
    if(exists $cookie{name}){
    	open(SESSION_READ,"<sesIDs.dat");
    	my $sessions = <SESSION_READ>;
    	chomp $sessions;
    	my %sesHash = split /\|/, $sessions;
    		
    	if($sesHash{$cookie{"username"}} eq $cookie{"id"}){
    		print $html->header();
    		print $cookie{"id"}, "DLKJF";
    		$loggedIn = 1;
    		%cookieHash = ("username",$cookie{"username"},"id",$cookie{"id"});
    		$madeCookie = $html->cookie(-name=>"StreamIt",-value=>\%cookieHash,-expires=>'+1h');
    	}
    	close SESSION_READ;
    }
    i am setting this cokie properly, but is that the right way to get it and check it against a file that i have usernames and ids stored it? it doesn't seem to work...

    this sesID's file contains stuff like

    Selina|8b88ad37b5153702fdfe13b5c41f8993|Alfred|ceec0cdc17b0e17c4135a1ba0c7b5ea0

    any ideas what i'm doing wrong??

    --770
    Last edited by delta770; Mar 17th, 2004 at 12:41 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width