Re: PHP Session in new window

From: Axrock (axrock_at_wazzup.co.nz)
Date: 01/23/05


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.



Relevant Pages

  • PHP Session in new window
    ... I have a shopping cart where all cart contents are stored in a session ... This is a new window ... Problem is on return (successful transaction etc) I cannot access the ...
    (alt.php)
  • Re: Frontpage query
    ... You need to select a target other than the default target which is probably ... To open your flash in a popup window while keeping your viewers on the ...
    (microsoft.public.frontpage)
  • Re: Why so much emotion about IWB 2.0.5? was re: other stuff and re: IBM Web Browser v2.0.5 is here
    ... It looks like IBM has fixed some of the problems reported as fixed in Mozilla 1.7.5. ... MFSA 2005-13 "Window Injection Spoofing" is still there. ... If you don't have popups blocked, the spoofed window does open, but it opens as a popup window so it doesn't seem very serious since popup windows can display just about anything their creator wants, anyway. ... You could be a victim in this way but it looks unlikely since there would first have to be the malicious website with the bad link and then you would have to be pretty 'unwise' to enter any significant data into ...
    (comp.os.os2.apps)
  • Re: Problem with session time out
    ... > still open up the child window and the redirection to the login page was ... But i would like to redirect on the parent ... > window instead of the popup window. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Hiding Access
    ... My client wanted a small form which displayed stats to reside on the top of ... Access disappears but also the popup window I want to display. ... Global Const SW_SHOWNORMAL = 1 ...
    (microsoft.public.access.forms)