NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Debugging, cookies, post data and more..


Joined: 05 May 2006
Posts: 5
Reply with quote
I have been trying other IDEs over the past few days and have noticed problems handling or controlling the debugger client’s requests to the remote server.

What I mean is this, if I have five pages (one.php through five.php) and I want to debug page five.php but I have to start at page one.php with proper request headers and cookies. Also, along the way to page five.php, cookies are used and changed. Will I be able to specify the initial request headers or cookies to page one.php? Will the debugger client maintain the cookies all the way to page five.php? Or does all this have to be done using an external browser?

If PHPED debugger allows the above, will I be able to change any of these values during a debug session? I did see in your video demos that I could change variables but what I mean is whether or not I could change cookie values or post data before moving from one page to the other during a debugging session.

I don’t know if I am explaining myself clearly, I am new to this.

Thank you,
Shahim
View user's profileFind all posts by ShahimSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Probably, you need to read books on how it all works. I mean html, php, cookies, posts etc.
Briefly, yes you can change values of variables, including $_COOKIE, $_POST etc, but even if you change the values it does not mean that cookies themselves will be changed. It's because you are changing them on the server where php runs, while cookies are stored and maintained by the client browser, regardless embedded into the IDE or external ones.
If you favorite browser does not let you change cookie values (mine does not too), PhpED IDE has nothing to do with it too.
On the other hand, why don't you run 5th page directly with necessary POST/COOKIE values specified on Run->Parameters?

Quote:
Will I be able to specify the initial request headers or cookies to page one.php? Will the debugger client maintain the cookies all the way to page five.php?

Run->Parameters
NOTE: Cookie and Post values are working only for embedded browser only. Get values are always working.

Quote:
Will the debugger client maintain the cookies all the way to page five.php?

Cookies are issued by server (by setcookie() in your php script, for example) and are stored and maintained by browser and only.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 05 May 2006
Posts: 5
Reply with quote
Thanks for your answers. The reason I am asking some of my qustions is that I am trying to understand a complex PHP application's scripts (typo3) and I am also new to PHP and want to see if PHPED will help me with this. Few more questions:

Is the embedded browser the system's default browser or IE?

Quote:
but even if you change the values it does not mean that cookies themselves will be changed.


Right, I guess it depends on whether the embedded browser is IE or if I could change it.

Quote:
why don't you run 5th page directly with necessary POST/COOKIE values specified on Run->Parameters?


Because sometimes I can tell what a script/class/function in typo3 is trying to do but I am not sure how it is used in the application, where it might be called from or what cookie/post data it might need to function correctly. So, I want to be able to set a break point in that script/class/function and then use the browser to login and brows until that break point it hit, at that point I can use the call stack and the variables window to understand what happened and where the script was called from.

I know that what I am trying to do might not make sense to an experienced programmer but it does help me learn the application faster.

Shahim
View user's profileFind all posts by ShahimSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Quote:
Is the embedded browser the system's default browser or IE?

IE
Quote:
Right, I guess it depends on whether the embedded browser is IE or if I could change it.

No. It's not browser dependant. Cookies are sent to the client with setcookie() function or using header() or some other ways but are never sent magically/automatically from $_COOKIE[] array.

Quote:
So, I want to be able to set a break point in that script/class/function and then use the browser to login and brows until that break point it hit

I don't see what could prevent you from doing it and get what you want Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 05 May 2006
Posts: 5
Reply with quote
Quote:
No. It's not browser dependant. Cookies are sent to the client with setcookie() function or using header() or some other ways but are never sent magically/automatically from $_COOKIE[] array.


Right, I was referring to changing the cookie values in the embedded browser before the next request is sent by clicking on a link or a form button. If I could change the embedded browser, to FireFox for example, I can change the values. It seems that it is better to use an external browser to do this and to check the output in that browser at the same time.

Thank you for all these answers. Great product and even better support. Very Happy

Shahim
View user's profileFind all posts by ShahimSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
you're welcome Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Debugging, cookies, post data and more..
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic