Recent

Author Topic: Synapse + login form + keep logged  (Read 3479 times)

Vingadero

  • New Member
  • *
  • Posts: 44
Synapse + login form + keep logged
« on: May 12, 2012, 08:54:17 pm »
Hello

Here what i'm trying to accomplish:
1) Log in Lazarus site
2) Parse unread items http://lazarus.freepascal.org/index.php?action=unread

To login i'm using this http://lazarus.freepascal.org/index.php/topic,16505.msg89794.html#msg89794
It seems that logs OK, but when I send another request to http://lazarus.freepascal.org/index.php?action=unread it wont be logged anymore...

How can I keep it logged?

Ty!

Vingadero

  • New Member
  • *
  • Posts: 44
Re: Synapse + login form + keep logged
« Reply #1 on: May 17, 2012, 04:04:05 am »
Accepting any suggestions...

lnet can do it?

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Synapse + login form + keep logged
« Reply #2 on: May 17, 2012, 08:16:10 am »
<Crystal ball mode>
You are using different THTTPSend instances for the login and the next page. Result: you are losing the cookies returned by the login.
</Crystal ball mode>
Don't use the convenience functions such as HttpGetText because they create a separate THTTPSend each time. Create your own THTTPSend instance and stick to it for the complete session and use the THTTPSend.HTTPMethod to Get or Post data. Look at how HttpGetText is implemented and you'll immediately understand how it works ;)


 

TinyPortal © 2005-2018