INTRODUCTION:
I am trying to go from one ND project (TestCookies) to
another (TestProjectLoad) and preserve user session data during
transitions.
In order to do that during ...button_onWebEvent(s) I execute
following code:
CSpProject project = CSpider.getProject("TestProjectLoad");
CSpCommonPage page = project.getCommonPage
( new CSpClassName("pgStart") );
page.load();
or
CSpider.switchToProject(new CSpClassName("TestProjectLoad"));
CSpCommonPage page = CSpider.getCommonPage( "pgStart" );
page.load();
If both of my projects are created with
SessionIdTrackingMetod: Field/URL
everything works fine,i.e. all session information
is maintained when switches between projects occur.
PROBLEM:
If I switch SessionIdTrackingMetod to cookie, session
information is not maintained any more.
ATTEMPT TO FIND SOLUTION
The default behaviour of ND cookie creation is to create
cookie that includes project name into path portion of
the cookie i.e:
path=/cgi-bin/nd_CGI_50.exe/TestProjectLoad
or
path=/cgi-bin/nd_CGI_50.exe/TestCookie
I believe that last portion of the path causes two
separate sessions (one per project) to be created and
maintained throught cookie SPIDERSESSION_ID.
The simple solution would be to specify path as
path=/cgi-bin/nd_CGI_50.exe
Problem is that I can not find a way to replace/modify
cookie that is created by ND. I tried various modification
of something similar to:
CSpHttp.reset();
CSpHttp.setAutoMode( false );
// CSpHttp.write(cookStr);
// CSpHttp.removeSessionCookie();
CSpHttp.writeCookie( "SPIDERSESSION_ID", "fsdfsd", null,
// "/cgi-bin/nd_CGI_50.exe", null, false );
CSpHttp.writeContentType("text/html");
Is there an easy way to modify cookie path info.
Drazen Beatovic
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]