problem with sessions in iframe

0 favourites
  • 2 posts
  • Hi Friends

    I tried to show my website on construct iframe window but I found it doesn't work well on those pages which I use sessions ( using php on server side ).

    as example on my php file I have this code to set and track username on other pages: $_SESSION['user'] = $row['user'];

    It works well on normal browswers but in construct iframe it seems it doesn't set session or it can't find user in other pages. maybe I should set some rules to allow iframe to use sessions? any idea why it doesn't work?

    Thanks in advanced

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I just found a solution on server side, I add this code before session_start on website php code and now everything works well on iframe:

    ini_set('session.cookie_samesite', 'None');

    session_set_cookie_params(['samesite' => 'None']);

    session_start();

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)