Re: PHP Session in new window
From: Axrock (axrock_at_wazzup.co.nz)
Date: 01/23/05
- Next message: Matthew Paterson: "image gallery"
- Previous message: Andy Hassall: "Re: Recommend a email list listsrv applcation, please"
- In reply to: Harrie Verveer: "Re: PHP Session in new window"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 24 Jan 2005 09:23:41 +1300
Hi,
I figured it out, and wanted to post a response in case anybody else has
this problem.
In the form that submits to the popup window, I passed through the session
id.
EG: Create a hidden field in my form with the session ID
<input type='hidden' name='PHPSESSID' value='<?= PHPSESSID ?>' ?>
When returning from the popup back to the original URL I set the PHPSESSID
back to the above.
It will re-enstate the sessions from that ID.
It works perfectly.
Ax
"Harrie Verveer" <newsgroup{remove-this}@harrieverveer.com> wrote in message
news:W7qdnQp6N47RCHrcRVnysA@zeelandnet.nl...
> Hi axrock,
>
> I think you can't do things with the session because you are switching
> between https and http... Do you really need the entire session from the
> popup window or just succes or not? You could try some javascript like
> this:
>
> <script language="JavaScript">
> window.opener.location = "success.php";
> </script>
>
> when you really want the session vars you could do this by get-vars:
>
> <?
> $passGetVars = array();
> foreach ($_SESSION as $key => $val)
> $passGetVars[] = $key . "=" . $val;
>
> $passGetVarsStr = "?" . implode("&",$passGetVars);
> ?>
>
> <script language="JavaScript">
> window.opener.location = "success.php<?=passGetVarsStr?>";
> </script>
>
> something like that... untested but should work - however, I don't think
> it's possible to just use the same session in the opener window and the
> popup window (because of the cross-protocol). this sollution isn't the
> most pretty solution in the world, but it should work...
>
> Harrie
>
> Axrock wrote:
>> Hi,
>>
>> I really need some help here.
>>
>> I have a shopping cart where all cart contents are stored in a session
>> array. At the checkout stage, a new window is opened on a secure URL for
>> entering credit card details. This is a new window (JavaScript popup)
>> because the payment section is actually part of the bank. They have a
>> payment gateway. I am able to pass variables to this which will be
>> returned.
>>
>> Problem is on return (successful transaction etc) I cannot access the
>> session variables in the parent browser window.
>>
>> Can I some how force the popup window (with some PHP code in the return
>> page) to pickup that session so I can access the session variables from
>> the parent window and update them based on my transaction result?
>>
>> I can and have the ability to pass the session id into the popup which
>> will be returned when the transaction is completed via the banks
>> automated system.
>>
>> If somebody can help me out in this area, I would really appreciate it.
>>
>> C.
- Next message: Matthew Paterson: "image gallery"
- Previous message: Andy Hassall: "Re: Recommend a email list listsrv applcation, please"
- In reply to: Harrie Verveer: "Re: PHP Session in new window"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|