Login by Curl - Page_Redirecting server event

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
twuc
User
Posts: 72

Login by Curl - Page_Redirecting server event

Post by twuc »

I have a cron job using curl to login: curl -v 'h**ps://my.org.uk/login?username=myuser&password=mypassword'
In Login Page_Redirecting, I have:

    if (IsLoggedIn()) {
           $username=CurrentUserName();
        Log("Is logged in: "&$username);
       
        if ($username=="myuser") {
            $url="PcBatchSync";
            Log("url is PcBatchSync");
            }
        }

The user is successfully logged in and displayed in the log, PcBatchSync is a custom file with list view and edit permissions and the url login works in the browser. "log.DEBUG: url is PcBatchSync" is displayed in the log but nothing else and the Project is PHPMaker2023.

Do I have to do something special for routing or is there some other possible explanation?


arbei
User
Posts: 9384

Post by arbei »

Did you mean you cannot get the content of PcBatchSync in your Curl result? Make sure you Tell curl to follow redirects.


twuc
User
Posts: 72

Post by twuc »

That worked after switching on the cookie engine:

curl -L -b "" http://example.com

Many, many thanks.


Post Reply