0

I have two web pages admin.php and user.php. admin.php has control over user.php.
I have 4 controls(buttons) in admin.php that 2 of them are for changing the template(appearence) of admin.php and work fine (I did it using cookie).

2 other controls(buttons) are for changing the template for user.php.
But I don't know how to achieve this?
Should I pass the cookies from admin.php to user.php? If so, how should I pass them? Or maybe I should use JavaScript?

Please help me with this problem.

1
  • If your two pages are set on the same domain, then you shouldn't have any trouble sharing cookies between the two
    – Tivie
    Feb 6, 2013 at 13:44

1 Answer 1

1

If your two pages are set on the same domain, then you shouldn't have any trouble sharing cookies between the two.

You just have to make sure you specify the correct domain. Use an absolute path instead of a relative one.

ex:

name=newvalue; expires=date; path=/; domain=.mydomain.org

Suggestion:

Since you're using php, why not using it to specify the template? Since it's a user configuration, you probably want it to last regardless of the user clearing the cookies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.