I have a page that usually uses AJAX to retrieve the cart/basket on the page.
I am trying to pdf the page and send it via email including the basket.开发者_Go百科
While PDF'ing I simply pass the HTML to the PDF server and the cart is being PDF'd with an empty cart (i.e. the session is not being recognised)
Next I tried file_get_contents() and the same problem occurred. - empty cart I tried the same with cURL also - empty cart
I have added the session id to the URL (?'. session_name() . "=". session_id()
) but this throws an error - "failed to open stream: HTTP request failed!”
It looks like I can get it to work, I just can't get it to recognise the session...
Any ideas?
The PDF server is remote. Unless you're handling session via some common method (for example, by using memcache with some form of session token that you can pass around), the remote server cannot view the user's session on the app server. Does that make sense? Much in the same way that my web-site can't view your session from Google, your PDF server cannot view your session from your application server. You'll need to come up with some other method of securely passing the data to the PDF server.
精彩评论