[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Request for Information


Hi,

>   Well I did try printing the value for $cookie  and gives me 
> the foll value:
>  
> EMBPERL_UID=df9c7b02f04343807ef7ab570ab43dc6; 
> SESSION_ID=97f3d8207d2e8d9afd7493ca28c3908a; 
> BIGipServerwebster2=593498284.20480.0000 
>  
> Also, while trying to retrieve the session, I tried supplying 
> the following values for $cookie:
> 1) EMBPERL_UID=df9c7b02f04343807ef7ab570ab43dc6; 
> SESSION_ID=97f3d8207d2e8d9afd7493ca28c3908a; 
> BIGipServerwebster2=593498284.20480.0000 
>  
> 2) EMBPERL_UID=df9c7b02f04343807ef7ab570ab43dc6; 
> 97f3d8207d2e8d9afd7493ca28c3908a; 
> BIGipServerwebster2=593498284.20480.0000 
>  
> 3) 97f3d8207d2e8d9afd7493ca28c3908a
>  
> But, each time, I get the same error , i.e. 
> Died at 
> /usr/local/ext/perl/5.8.0/lib/site_perl/Apache/Session/Generat
> e/MD5.pm line 40.
> 

As Perrin already wrote only the last one is a valid session id you can pass
to tie.

Anyway Embperl already handles session retrival for you and you only need to
access the values in %udat to get your session data.

If you really want to do it one your own you need to change the regex to
extract the session id:

      $cookie =~ /SESSION_ID=([a-z0-9]+)/;
	$cookie = $1 ;

Otherwise you have other cookie data in your session id which doesn't work. 

Gerald



>  
> 
> Let me know what do you think. Is it an issue with cookie or 
> with retrieving sessions ?  Also, what value needs to be 
> supplied for $cookie while trying to retrieve a session.
> tie %session, 'Apache::Session::File', $cookie,
> 
> {  Directory => './tmp/sessions' ,
>    LockDirectory => './var/lock/sessions' , };
>  
>  
> Your help is really appreciated.
>  
> Thanks & Best Regards,
> Dhaval Gada.
> 
> On 8/30/06, Perrin Harkins <suppressed> wrote: 
> 
> 	[ Please keep replies on the mailing list ]
> 	
> 	On Wed, 2006-08-30 at 09:29 -0400, dhaval gada wrote:
> 	
> 	> If its the 1st time... then the following code. (i.e. session
> 	> creation)
> 	>
> 	> [-
> 	> eval   {
> 	>           tie %session, 'Apache::Session::File', undef,
> 	>             { Directory => './tmp/sessions', 
> 	>               LockDirectory   => './var/lock/sessions',
> 	>             };
> 	>         };
> 	> if ($@)  {
> 	>             die "Global data is not accessible: $@";
> 	>            }
> 	>
> 	>        $session{"manpage"} = new BFM::ManPage();
> 	>        $session{"visit"} = '1 all';
> 	>        $tp = yes;
> 	>
> 	>        my $session_cookie = 
> "SESSION_ID=$session{_session_id};"; 
> 	>        $r->header_out("Set-Cookie" => $session_cookie);
> 	> -]
> 	
> 	Okay, and you said that seemed to work.  I'd be nervous 
> about your use
> 	of relative directories in those path names, personally. 
> 	
> 	> And if not the 1st time... then the following 
> code.(i.e. retrieving
> 	> established session)
> 	> [-
> 	>       $r = Apache ->request;
> 	>       $cookie = $ r->header_in('Cookie');
> 	>       $ cookie =~ s/SESSION_ID=(\w*)/$1/; 
> 	>
> 	>       eval {   tie %session , 
> 'Apache::Session::File', $cookie,
> 	>                  {  Directory => './tmp/sessions',
> 	>                      LockDirectory => './var/lock/sessions',
> 	>                  }; 
> 	>              };
> 	>
> 	>        if ($@)
> 	>        {     die "Global data is not accessible: $@";  }
> 	> -]
> 	
> 	And that's where it dies on you?  Have you checked the 
> value of $cookie
> 	inside that eval?  Maybe it isn't what you think it is.
> 	
> 	- Perrin
> 	
> 	
> 
> 
> 


 
** Virus checked by BB-5000 Mailfilter ** 


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.