Help needed in Perl LWP module


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help needed in Perl LWP module
# 1  
Old 10-04-2006
Power Help needed in Perl LWP module

Hi,

I've a issue in writing a perl script that will automatically monitor the site availability.
There are two different cookies are set in two consecutive flows to a URL and this second cookie has to be passed to the third step which actually gives permission to access based upon the cookie.

cookies set in the Ist flow by the site:
Set-Cookie: SaneID=xyz-xyz; path=/; expires=Wed, 04-Oct-11 13:31:58 GMT; domain=.xxx.com
Set-Cookie: sessionid=0001DCQZ0CCCDWPCT0T43FPXH2Y;Path=/; Secure


cookies sent in the Ist flow by the script:

Cookie: SaneID=xyz-xyz; path=/; expires=Wed, 04-Oct-11 13:31:58 GMT; domain=.xxx.com
Cookie2: $Version="1"



cookies set in the second flow by the site:

Set-Cookie: CRED=xFD0kq+lt8Q/SUFQbUwqvhDynTpSW2/t4F6JHEoeyUZ23Cll+fEAJfGE9Bq4rrLDvbsquY4Ox/5GFiVrOOp3ZzEAVRfy9UZSFaH1x8yipP0=;path=/; domain=.xxx.com; secure

Cookies sent in second flow by the script:

Cookie: SaneID=xyz-xyz; path=/; expires=Wed, 04-Oct-11 13:31:58 GMT; domain=.xxx.com
Cookie2: $Version="1"


My question is why is the latest cookie namely CRED not sent in the second flow?

The code related my cookie is
$cookie_jar = HTTP::Cookies->new();

$cookie_jar->add_cookie_header($request);
$response = $useragent->request($request);
$cookie_jar->extract_cookies($response);

Can anyone please help me?

Thanks. Smilie
# 2  
Old 10-05-2006
Quote:
Originally Posted by dayanandra

cookies set in the second flow by the site:

Set-Cookie: CRED=xFD0kq+lt8Q/SUFQbUwqvhDynTpSW2/t4F6JHEoeyUZ23Cll+fEAJfGE9Bq4rrLDvbsquY4Ox/5GFiVrOOp3ZzEAVRfy9UZSFaH1x8yipP0=;path=/; domain=.xxx.com; secure
But there is no expiration date for the cookie. So it's a session cookie. Session cookies are not normally saved to any cookie jars, because they are by definition valid for the current "session" only, and no persistence is needed. This really depends on how you write your script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl module

I am recieiving an out of memory issue in my perl module while updating the records in the oracle table. Let me know what are the check or troubleshoot steps need to be done from my end to fix the issue. (1 Reply)
Discussion started by: ramkumar15
1 Replies

2. Shell Programming and Scripting

parsing a webpage - perl lwp

I am requesting for the text parsing section below. Any helps are highly appreciated. <tr valign="top"><td nowrap>Source name</td> <td style="text-align: justify">Sample Name<br></td> I want Sample Name from above. In the same file, I have to search for another pattern like this <td><a... (1 Reply)
Discussion started by: jacobs.smith
1 Replies

3. Shell Programming and Scripting

Perl SSH without a perl module

I'm trying to create a perl script that will do 1 SSH session, but be able to write multiple commands to the session and receive multiple outputs. I know there are modules out there like Net:SSH::Perl, but I'm not allowed to use it. I was thinking of doing something like an open3 on an ssh... (4 Replies)
Discussion started by: mrwatkin
4 Replies

4. Shell Programming and Scripting

perl lwp find word and print next word :)

hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this: I have in my response lines like: <div class="sender">mimi020</div> <some html code.....>... (3 Replies)
Discussion started by: vogueestylee
3 Replies

5. Shell Programming and Scripting

Perl LWP user authentication

Hello all.. i am new to perl scripting.. i wanted to parse a text file, encode the parsed text and attach in url.. please point me to right resources if you know any..This is my major problem. Now i try to get a url running and save it in a text file using LWP module in perl, I used following... (0 Replies)
Discussion started by: empyrean
0 Replies

6. Shell Programming and Scripting

calling perl subroutine from perl expect module

All, Is it possible to call a subroutine from the perl expect module after logging to a system that is within the same program. My situation is I need to run a logic inside a machine that I'm logging in using the expect module, the logic is also available in the same expect program. Thanks,... (5 Replies)
Discussion started by: arun_maffy
5 Replies

7. Shell Programming and Scripting

Login using perl LWP module

Hi, Could some one tell me how to login to any web site and get that page using perl LWP. I heard that we can login to the site using LWP. I dont want to use WWW:Mechanize as I dont have that module installed on the server. Appreciate your early response. Thanks... (8 Replies)
Discussion started by: Anjan1
8 Replies

8. Shell Programming and Scripting

perl module installation problems... experts advice needed,...

---------- This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) ----------in win 2000 advanced server,.. i am somewhat comfortable with perl but i am new to perl modules.. when i tried to install xml::simple and xml::parser there... (4 Replies)
Discussion started by: sekar sundaram
4 Replies

9. Shell Programming and Scripting

Replace Perl Module name in all Perl scripts

I want to replace a Perl module name in all my Perl Scripts in the cgi-bin directory. How is it possible? I have the following statement in my scripts use myUtil; I want to change it to use myUtil777; Regards, Rahul (2 Replies)
Discussion started by: rahulrathod
2 Replies

10. UNIX for Dummies Questions & Answers

LWP module ?

my host run on a Free bsd server and i have a cgi script that requires LWP module, but i my host say that that module is installed, so i would like to know if the is a command because i have telnet access to know if the module or which modules are installed on my account (itīs that the script donīt... (4 Replies)
Discussion started by: Beto
4 Replies
Login or Register to Ask a Question