Forums / General Questions / I want to add 2 var in $_SESSION

I want to add 2 var in $_SESSION

Views: 790

Results 1 to 4 of 4
26 May 2012, 8:17 AM
#1
linjuming avatar

linjuming

Zen Follower

Join Date:
Apr 2012
Posts:
151
Plugin Contributions:
0

I want to add 2 var in $_SESSION

I want to add two vars
$_SESSION['back_url'] and $_SESSION['current_url'];
$_SESSION['back_url'] is for storing the history back page
$_SESSION['current_url'] is for $_SERVER['REQUEST_URL']

26 May 2012, 9:36 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: I want to add 2 var in $_SESSION

linjuming:

I want to add two vars
$_SESSION['back_url'] and $_SESSION['current_url'];

Easier than you think.

$_SESSION['back_url'] = "enter your back URL here" ;
$_SESSION['current_url'] = "enter your current URL here" ;

Reading them back is as simple as

$back_url = $_SESSION['back_url'] ;
$current_url = $_SESSION['current_url'];

Having said that though, I suspect that just knowing this isn't going to take care of what it is that you are actually wanting to do.

What is the problem you are trying to solve?

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

26 May 2012, 9:51 AM
#3
linjuming avatar

linjuming

Zen Follower

Join Date:
Apr 2012
Posts:
151
Plugin Contributions:
0

Re: I want to add 2 var in $_SESSION

no mater why I want to add two items in $_SESSION;
can anyone tell me how to add them for no reasion?

26 May 2012, 9:59 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: I want to add 2 var in $_SESSION

linjuming:

can anyone tell me how to add them for no reasion?

I just did! :frusty:

Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.