You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by st...@btinternet.com on 2001/11/12 15:46:39 UTC

Sessions inconsistent

Hi

Sometimes I can retrieve data out of %udat, sometimes I can't. I tried adding domain and path environment variables to no avail.

PerlSetEnv EMBPERL_SESSION_CLASSES "MySQL Semaphore"
PerlSetEnv EMBPERL_SESSION_ARGS "DataSource=dbi:mysql:webdata UserName=mgmtsesh69"
PerlSetEnv EMBPERL_SESSION_DOMAIN .quicks.co.uk
PerlSetEnv EMBPERL_SESSION_PATH /

Regards
Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Sessions inconsistent

Posted by Gerald Richter <ri...@ecos.de>.
>
> Are you saying that ALL of the EMBPERL_SESSION_[INSERT NAME HERE]
> variables are global?
>

Yes

EMBPERL_SESSION_CLASSES
EMBPERL_SESSION_ARGS
EMBPERL_SESSION_HANDLER_CLASS

are global

EMBPERL_COOKIE_*

are _not_ global and can be set different in different contexts (By setting
a different cookie name you get a different session for different projects)

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Sessions inconsistent

Posted by David Lloyd <ll...@rebel.net.au>.
Gerald!

> That's dangerous, because you can't have different values for these
> configuration directives. They are global. (Yes that's something that should
> be changed sometime, but it isn't yet). If you have different values the
> session management get's initialized with the values from the first request,
> so it's becomeing even worth if differnet childs have different first
> requests and get differently initialized. (I guess that's what you are
> seeing in conjuction with EmbperlObject)

Are you saying that ALL of the EMBPERL_SESSION_[INSERT NAME HERE]
variables are global?

DSL
-- 
If we could extract all the evil from each of us,
 Think of the world that we could create!
 A world without anger, or violence or strife...
 (From the Musical, Jekyll and Hyde)

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Sessions inconsistent

Posted by Gerald Richter <ri...@ecos.de>.

>
> > 1.) PerlModule HTML::Embperl
>
> <snip>
>
> > For 1., put the PerlSetEnv with the session vars, before the PerlModule
> > statment in your httpd.conf
>
> I have finally managed to get session management working; I used to have
> the EMBPERL_SESSION_CLASSES and EMBPERL_SESSION_ARGS in my </Location
> sessionLocation> without using a PerlModule statement.

That's dangerous, because you can't have different values for these
configuration directives. They are global. (Yes that's something that should
be changed sometime, but it isn't yet). If you have different values the
session management get's initialized with the values from the first request,
so it's becomeing even worth if differnet childs have different first
requests and get differently initialized. (I guess that's what you are
seeing in conjuction with EmbperlObject)

Beside the fact that loading Embperl (as any other Perl module) is more
memory efficient, it save you a lot of problems. So just put that

PerlModule HTML::Embperl

in somewhere and set your session variables before.

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Sessions inconsistent

Posted by David Lloyd <ll...@rebel.net.au>.
Gerald!

> 1.) PerlModule HTML::Embperl

<snip>

> For 1., put the PerlSetEnv with the session vars, before the PerlModule
> statment in your httpd.conf

I have finally managed to get session management working; I used to have
the EMBPERL_SESSION_CLASSES and EMBPERL_SESSION_ARGS in my </Location
sessionLocation> without using a PerlModule statement. I'd have
something like:

<Location somewhere>
PerlSetEnv blah

SetHandler perl-script
PerlHandler HTML::EmbperlObject
</Location>

WITHOUT a PerlModule HTML::Embperl statement anywhere in httpd.conf.

For some totally obscure reason (at least to me), HTML::Embperl(Object)
would randomly (well, there seems to be some order but I can't work it
out yet) decide to start session management or stop it...

<sigh>

DSL
-- 
If we could extract all the evil from each of us,
 Think of the world that we could create!
 A world without anger, or violence or strife...
 (From the Musical, Jekyll and Hyde)

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Sessions inconsistent

Posted by Gerald Richter <ri...@ecos.de>.
>
> Stupid question, but how do you make sure it's set BEFORE embperl is
> loaded?
>

You can load Embperl in three way (when using mod_perl)

1.) PerlModule HTML::Embperl
2.) in a startup file which is loaded via PerlRequire, you say use
HTML::Embperl
3.) you don't load it explicitly, the mod_perl does it on the first request
(not recommended, because it less efficient)

For 1., put the PerlSetEnv with the session vars, before the PerlModule
statment in your httpd.conf
For 2., put the PerlSetEnv with the session vars, before the PerlRequire
statment in your httpd.conf, or the $ENV setup in a BEGIN block before the
use
For 3. it doesn't matter where you setup the config, as long as it is
somewhere in your httpd.conf

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Sessions inconsistent

Posted by David Lloyd <ll...@rebel.net.au>.
Stupid question, but how do you make sure it's set BEFORE embperl is
loaded?

DSL
-- 
If we could extract all the evil from each of us,
 Think of the world that we could create!
 A world without anger, or violence or strife...
 (From the Musical, Jekyll and Hyde)

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Sessions inconsistent

Posted by Gerald Richter <ri...@ecos.de>.
Hi
>
> Sometimes I can retrieve data out of %udat, sometimes I can't. I tried
adding domain and path environment variables to no avail.
>
> PerlSetEnv EMBPERL_SESSION_CLASSES "MySQL Semaphore"
> PerlSetEnv EMBPERL_SESSION_ARGS "DataSource=dbi:mysql:webdata
UserName=mgmtsesh69"
> PerlSetEnv EMBPERL_SESSION_DOMAIN .quicks.co.uk
> PerlSetEnv EMBPERL_SESSION_PATH /
>

The config is ok. Make sure it is set before Embperl is loaded.

Do see something like "Embperl session management enabled" at server startup
?

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org