We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Use oxwall SESSIONS in non-oxwall php core? [ Open ] | Forum

ketkew
ketkew Dec 2 '15
My situation is:

- parent window: http://myoxwallpoweredsite.com
- child window: http://myoxwallpoweredsite.com/customphpcode (not related to oxwall)

On the parent window the child window can simply be opened via url, target=_blank.

I would like to use  $_SESSION['userId'] from oxwall in my custom php code in the child window, but when I print the session on the screen an empty value is returned, while on the parent window the session is successfully returned.

I know that it is possible once a session has been set in the parent window it should be available in the child window once served on the same domain, but somehow it is not possible from an oxwall powered website..

I tested this also without an oxwall powered website and this works..

Any ideas?

(The user in this topic had the same issue but the answer given was not related to the actual problem..)
The Forum post is edited by Aliya Nov 25 '16
Youssef
Youssef Nov 3 '16
i'm looking for the same answer, i've searched in all the forum, but can't find the right answer :(
dave Leader
dave Nov 21 '16
Youll probably have to pass the values using $_GET or $_POST to the outside file.  You also might be able to pass it with ajax as well.   Just remember that if the new php file is withing the oxwall structure you will need to add the custom file in your htaccess file. 


Also remember that SESSION is not always set right away, it may take a page refresh to capture the value because typically the page loads faster than the session can be set. 


You also may not get the data you want using $_SESSION  array.  There are class functions in the oxwall core to set, get, and delete session values, so you may have to grab those and then pass the data down to your oxwall php file and then pass it to the outside file form there.