Script for user login

I would to like to run a script based on user login.

Have tried the sample script which is given in the documentation phase of webpagetest, but am getting the error. Can someone please assist me with an example script?

Is the setcookie needs to be used along with the setvalue? if so how is that possible for gmail login scenario

Cheers
Zach

Here’s one from a talk I did with Aarron Peters - Web Page Test - Beyond the Basics

combineSteps 
navigate https://zakelijk.vodafone.nl 
setValue name=username xxxxxxxxxxxx 
setValue name=password xxxxxxxxxxxx 
submitForm name=login

I also quite often use execandwait to complete forms, click buttons etc.