execute a php code from wt
Added by Mohammed Rashad over 14 years ago
Hi all,
I set a cookie from an application login.wt and access it from main.wt
I cannot do this with Wt. in the same application I can get and set cookie within the same application
but php can do cookie setting and getting. so
how to execute a php code from Wt
or
how to pass cookies between different Wt application
Replies (4)
RE: execute a php code from wt - Added by Wim Dumon over 14 years ago
Mohammed,
This should work. Set the cookie with WApplication::setCookie(), read it through WEnvironment::getCookie().
- Can you check that the browser indeed knows the cookie? (Firefox: tools~~options~~>security->show cookie)
- Did you set your domain and path correctly, so that the browser effectively transmits the cookie?
- Did you verify with firebug that the request header of accesses to main.wt contains the cookie?
- Cookies are only interpreted by Wt when the session is initiated. Cookies added later will not be visible in the WEnvironment object.
BR,
Wim.
RE: execute a php code from wt - Added by Mohammed Rashad over 14 years ago
Can you check that the browser indeed knows the cookie? (Firefox: tools~~options~~>security->show cookie)
Yes browser shows cookie
Did you set your domain and path correctly, so that the browser effectively transmits the cookie?
How to set it?
Did you verify with firebug that the request header of accesses to main.wt contains the cookie?
How to verify?
Cookies are only interpreted by Wt when the session is initiated. Cookies added later will not be visible in the WEnvironment object.
not clear...
please help
waiting for your reply
RE: execute a php code from wt - Added by Wim Dumon over 14 years ago
Mohammed Rashad wrote:
Can you check that the browser indeed knows the cookie? (Firefox: tools~~options~~>security->show cookie)
Yes browser shows cookie
Verify that path and domain are correct for your application. Read about cookies on the net (ask google) to understand what the domain and path parameters do.
Did you set your domain and path correctly, so that the browser effectively transmits the cookie?
How to set it?
There are parameters in WApplication::setCookie()
Did you verify with firebug that the request header of accesses to main.wt contains the cookie?
How to verify?
With firebug, net panel, and then look at the raw headers.
RE: execute a php code from wt - Added by Mohammed Rashad over 14 years ago
I set the path to /wt/myapp/main/ in the set cookie option and now I can access the cookie from other application