share a session between two website

A

alexjaquet

Hi,

I need to share a session between two website, I've tried access it
with

local our $session = new CGI::Session( "driver:File", $session_id,
{Directory=>"$sessiondir"} );
local our $username =$session->param("username");

from the second site but it doesn't work, any idea ?

Thks
 
M

Matt Garrish

Hi,

I need to share a session between two website, I've tried access it
with

local our $session = new CGI::Session( "driver:File", $session_id,
{Directory=>"$sessiondir"} );
local our $username =$session->param("username");

from the second site but it doesn't work, any idea ?

Why would it work? You create a file on server1 and expect the file to
magically exist on server2?

Use a database to store the session that bother servers can access.

Matt
 
M

Matt Garrish

In fact the two website exist one the same server, one is the website
and the second is the forum :
http://avant-garde.no-ip.biz/cgi-bin/recordz.cgi?lang=FR
http://community.no-ip.biz/cgi-bin/community.cgi?lang=FR

Please quote context when posting. Just because you use Google groups to
post doesn't excuse you from following the posting guidelines.

CGI::Session stores the session identifer in a cookie. Are you sure that the
second site is able to access that cookie? Are you checking errstr() for
more info?

Matt
 
A

alexjaquet

"CGI::Session stores the session identifer in a cookie. Are you sure
that the
second site is able to access that cookie? Are you checking errstr()
for
more info? "

I get this error msg when trying to call errstr

local our $session = new CGI::Session( "driver:File",
$session_id, {Directory=>"$session_dir"} );
local our $username =$session->param("username");
print "Content-Type: text/html\n\n";
print "$username username\n";
local our $error = CGI::Session::errstr;
print "$error\n";

but I think you 're rigth when you said this is not accessible outside
the web app context (url is different)
 
M

Matt Garrish

"CGI::Session stores the session identifer in a cookie. Are you sure
that the
second site is able to access that cookie? Are you checking errstr()
for
more info? "

The effort to follow the posting guidelines is appreciated, but it looks
like you're copying and pasting. Google groups does have a way to reply with
proper attribution which will make your life easier:

http://groups.google.com/support/bin/answer.py?answer=14213&topic=250
I get this error msg when trying to call errstr

local our $session = new CGI::Session( "driver:File",
$session_id, {Directory=>"$session_dir"} );
local our $username =$session->param("username");
print "Content-Type: text/html\n\n";
print "$username username\n";
local our $error = CGI::Session::errstr;
print "$error\n";

but I think you 're rigth when you said this is not accessible outside
the web app context (url is different)

They both appear to be subdomains, so you should be able to configure the
cookie so that it's available to both:

$cookie =
CGI::Cookie->new(-name=>$session->name, -value=>$session->id, -domain =>
'.no-ip.biz');
print $cgi->header(-cookie=>$cookie);

See the header() function in the CGI::Session documentation for more info.

Matt
 
B

Brian Wakem

A. Sinan Unur said:
He has been asked to follow the guidelines many, many times.


He has also been asked many times why he uses local our instead of my.

Sinan


local our is common usage in mod_perl.
 
A

A. Sinan Unur

Brian Wakem said:
....

local our is common usage in mod_perl.

Yeah, I guess. I do do some mod_perl programming and I seem to do just
fine by wrapping everything in a handler sub and using my variables.

Using local our for everything? Surely that is a little overdone.

Sinan

--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top