This forum is archived. Posts are preserved for historical reference. For current help, join us on Discord.

Not Logged in Redirect

In Off-topic Discussions · Started by truemama on 2017-07-10 3:52 pm · 5657 views · 1 replies

Hi all - really liking userspice guys, great work. Need a bit of help...

I'm taking the user from a Public to a Private webpage and userspice redirects the user to the login page. It looks like there is a great feature wherby userspice retains where the user was going and then redirects the user once they have completed the login page it takes them to where they were going originally....great but... I'm losing a variable so if my link pre login was:

/usersc/mypage.php?id=5

it redirects to just

usersc/login.php?&dest=usersc/mypage.php

but loses the ?id=5 which is the variable I want to hold onto..

any ideas?

Cheers,

Matt
The easiest thing to do without modifying the Redirect class is to simply store the ID in a session variable. I'd use two, one for the current page and one for the previous page. Be sure to update the previous ID before the new current ID:
$_SESSION['previous_page_id'] = $_SESSION['current_page_id'];
$_SESSION['current_page_id'] = $current_page_id;