'm trying to pass the URL of a page to a session variable

Talk about add-ons and extension development.
Post Reply
infowebseology
Posts: 2
Joined: August 2nd, 2015, 8:55 pm

'm trying to pass the URL of a page to a session variable

Post by infowebseology »

I'm trying to pass the URL of a page to a session variable, so i can use it in a login plugin. The login plugin only refers to the profile page, but it won't refer to the previous page the user was on. I've tried using wp_get_referer(); in the login plugin itself, but because the login form sends it to a different page, the previous page according to wordpress is the login page.

In order to do this i first of all put the following in my functions.php:

add_action('init', 'myStartSession', 1);

function myStartSession() {
if(!session_id()) {
session_start();
}
}
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: 'm trying to pass the URL of a page to a session variabl

Post by lithopsian »

Are you actually writing an addon? Or a PHP script?
Post Reply