I am having an issue where a member is signing on to their members only page and its loads but if they refresh it loads another's members profile.

Members Only Issues
- bj.lewis221
- Thread is marked as Resolved.
-
-
Also, on Incognito I can go straight to the members only page without having to login
-
oh code!
my members area folder is 'dashboard'
this is my dashboard/index.phpPHP- <?php include('../login/runtime.php'); ?>
- <?php
- if (perch_member_logged_in()) {
- echo '';
- } else {
- header("Location: /dashboard/login.php");
- exit;
- }
- ?>
- <?php perch_layout('global.header'); ?>
- <?php perch_layout('global.dashboardheader'); ?>
- <?php $project_id = perch_get('s'); ?>
- <?php $member_id = perch_member_get('company'); ?>
- <section class="bonjour">
- <div class="container c1280">
- <div class="row pd-60">
- <div class="eight columns">
- <?php
- if (perch_member_logged_in()) {
- echo '<div class="project-list"><h1 class="nm"><a href="request.php" class="nm project-title center">Request New Project</a></h1></div>';
- my_sample_listing_custom(array(
- 'filter' => 'thingDynamicFields',
- 'match' => 'contains',
- 'value' => $member_id,
- 'template' => 'listing.html',
- ));
- }
- ?>
- </div>
- <div class="four columns">
- <?php perch_layout('global.sidebar'); ?>
- </div>
- </div>
- </div>
- </section>
- <?php PerchUtil::output_debug(); ?>
- <?php perch_layout('global.footer'); ?>
this is the global.sidebar
PHP- <div class="project-list">
- <?php
- if (perch_member_logged_in()) {
- echo '<h2 class="sidebar">' .perch_member_get('company') .'<br> Client Dashboard</h2>';
- $first = perch_member_get('first_name');
- if (perch_member_get('profile_picture')) {
- echo '<img src="' . perch_member_get('profile_picture') . '" width="100%" class="circle_img">';
- } else {
- echo '<img src="https://dummyimage.com/400/';
- perch_content_custom('Brand Colors', [
- 'page'=>'/brand-assets.php',
- 'template' => 'color.html',
- 'sort' => 'color',
- 'sort-order' => 'RAND',
- 'count'=>1
- ]);
- echo'/fff.jpg&text=';
- echo $first[0];
- echo '" width="100%" class="circle_img" alt="">';
- };
- echo '<div class="center">';
- echo '<h3 class="sidebar">Quick Links</h3>';
- if (perch_member_get('company_fbook')) {
- echo '<a href="http://facebook.com/' . perch_member_get('company_fbook') . '" target=_blank" class="sidebar-icon"><span class="icon-facebook2"></span></a>';
- } else {
- };
- if (perch_member_get('company_insta')) {
- echo '<a href="http://instagram.com/' . perch_member_get('company_insta') . '" target=_blank" class="sidebar-icon"><span class="icon-instagram"></span></span></a>';
- } else {
- };
- echo '</div>';
- if (perch_member_get('company_web')) {
- echo '<a href="http://' . perch_member_get('company_web') . '" target=_blank" class="button u-full-width">My Website</a>';
- } else {
- };
- echo '<a href="/dashboard/index.php" class="button u-full-width">dashboard</a>';
- echo '<a href="/dashboard/profile.php" class="button u-full-width">edit profile</a>';
- echo '<a href="/dashboard/logout.php" class="button u-full-width">log out</a>';
- }
- ?>
- </div>
- <?php
- if (perch_member_logged_in()) {
- echo '<div class="project-list">';
- echo '<h2 class="sidebar">Featured Project</h2>';
- perch_content_custom('Featured Project', [
- 'page'=>'/brand-assets.php',
- 'template' => 'project_ad.html',
- 'sort' => 'project_ad_title',
- 'sort-order' => 'RAND',
- 'count'=>1
- ]);
- echo '</div>';
- }
- ?>
- <?php PerchUtil::output_debug(); ?>
-
The issue seams to happen when I click on the 'dashboard' button line 44 in the second set of code.
When I log into member A's profile member A's loads to dashboard/index.php with member A's info but then I click the 'dashboard' button it loads dashboard/index.php with member B's info.
THEN I refresh and it shows Member A's info again, and it just goes in that loop over and overthis is happening on incognito and on a computer/network that has never logged into any other profile but member A.
-
Ok, so after letting the incognito page chill for about 10 mins, it stays on member A's info with refresh, ctrl+refresh and pushing the dashboard button....
-
ok so still not working and member A is seeing info for member b and member c I dont know what to do
-
-
Have you tried reducing to a simplified test case?
-
No, I will have to set that up and try out of the box members area.
If that works fine do you have any inklings? My first thought is caching but member a has never logged in as any other member and they don’t have a certain tag.
It’s very strange because it will work for me where I only see my member but then member A sees other profiles but member B‘s seem to work fine
-
It's hard to say because I don't know what you're trying to do. You appear to have the Sample app mixed in with your page, which shouldn't really be happening. It's hard to offer any pointers.
-
You can't use a custom built app with the members app?
-
You can certainly use a custom built app. But you build a custom app - not use the sample app. That's supposed to be an example - it's not production ready. It's full of nonsense "thing" classes.
-
I am just learning how to build the custom apps and just used the sample app as base I have made several changes, just haven't messed with the names and stuff yet until I get a better hang of it. I have made it work for what I wanted it to do. But essentially each "thing" has a client name on it and in the members area Member A only sees "things" with Member A on the "thing" and also I have a sidebar that displays the members information like their name and company name.
And what sometimes happens is Member A see's Member B's name and other information and also Member B's "things", but if Member A refreshes they will see Member A's stuff again then if they press the "dashboard" button which goes to the members index.php file it will load Member B's info again -
Ok, that very much sounds like it could be a logic issue in your app. The first thing to do is test the Members functionality on its own.
-
The issue was with login page redirection once I fixed that everything worked beautifully!