Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl Win32::Internet and Session cookies

Reply
Thread Tools

Perl Win32::Internet and Session cookies

 
 
omantawy@gmail.com
Guest
Posts: n/a
 
      09-19-2005
I am trying to create a Perl script that monitors a web site.
This website requires user name and password and when you request the
login form, the server send you a session cookie which is reused
when submitting the form.

I tried to get this cookie using the Win32::Internet but failed.
I have to use Win32::Internet becuase the form is retrieved using HTTPS
not HTTP.

Thanks in advance.

 
Reply With Quote
 
 
 
 
Brian Wakem
Guest
Posts: n/a
 
      09-19-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> I am trying to create a Perl script that monitors a web site.
> This website requires user name and password and when you request the
> login form, the server send you a session cookie which is reused
> when submitting the form.



Use LWP or WWW::Mechanize


> I tried to get this cookie using the Win32::Internet but failed.



Did your computer explode? Saying it failed is pointless without a
description.


> I have to use Win32::Internet becuase the form is retrieved using HTTPS
> not HTTP.



That is no reason to use Win32::Internet.


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      09-19-2005
(E-Mail Removed) wrote:

> I tried to get this cookie using the Win32::Internet but failed.
> I have to use Win32::Internet becuase the form is retrieved using HTTPS
> not HTTP.


http://johnbokma.com/perl/https.html might solve that part .

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html

 
Reply With Quote
 
omantawy@gmail.com
Guest
Posts: n/a
 
      09-20-2005
Using LWP or WWW::Mechanize requires the Crypto module to be installed
and the openSSL as well to access the HTTPS protocol.

When using the Win32::Internet, the server redirects me back to the
login form since I am sending the request without any session cookies.

Is it possible to maintain the session cookies with Win32::Internet?

 
Reply With Quote
 
Brian Wakem
Guest
Posts: n/a
 
      09-20-2005
(E-Mail Removed) wrote:

> Using LWP or WWW::Mechanize requires the Crypto module to be installed
> and the openSSL as well to access the HTTPS protocol.
>
> When using the Win32::Internet, the server redirects me back to the
> login form since I am sending the request without any session cookies.
>
> Is it possible to maintain the session cookies with Win32::Internet?



I don't really touch windoze these days so I'll take your word for it.


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
 
Reply With Quote
 
Mothra
Guest
Posts: n/a
 
      09-20-2005
Hello,

(E-Mail Removed) wrote:
> Using LWP or WWW::Mechanize requires the Crypto module to be installed
> and the openSSL as well to access the HTTPS protocol.
>
> When using the Win32::Internet, the server redirects me back to the
> login form since I am sending the request without any session cookies.


The reason you are being redirected back to the login page is not the
cookies
its because you have not established a secure connection.

HTTPS is the protocol for accessing a secure Web server where authentication
and
encrypted communication is possible. Using HTTPS in the URL instead of HTTP
directs the message to a secure port number rather than the default
Web port number of 80. The default TCP/IP port of HTTPS is 443.

> Is it possible to maintain the session cookies with Win32::Internet?


Mr. Bokma has already provided you with an excellent way to solve
your problem. I would suggest you take his advice.

Mothra


 
Reply With Quote
 
John Bokma
Guest
Posts: n/a
 
      09-20-2005
(E-Mail Removed) wrote:

> Using LWP or WWW::Mechanize requires the Crypto module to be installed
> and the openSSL as well to access the HTTPS protocol.


Which is the problem? http://johnbokma.com/perl/https.html explains how to
do this.

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html

 
Reply With Quote
 
omantawy@gmail.com
Guest
Posts: n/a
 
      09-21-2005
I think I am going to discard the idea of doing this using the
Win32::Internet.
I used WWW::Mechanize and had to install the Crypt-SSLeay and OpenSSL
and
it worked just fine.

Thank you all for your help.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Give Request.Cookies and Response.Cookies is there any reason to use another method to use cookies? _Who ASP .Net 7 09-18-2008 07:49 PM
Persistant cookies and non-persistant cookies. archana ASP .Net 1 05-25-2007 08:43 AM
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Persistent Cookies vs. session cookies Andy Fish Java 3 11-06-2003 10:44 AM
How can I "know" the difference between a session timed out and a session that did session.abort? Jazzis ASP General 2 09-23-2003 07:16 AM



Advertisments