www.webdeveloper.com
Results 1 to 2 of 2

Thread: Cannot set session variable

  1. #1
    Join Date
    Jul 2012
    Posts
    13

    Cannot set session variable

    Hi,

    I have have a simple problem which I feel like it can be easily solved. I have a folder named "Processing" with a file named login.php inside. I also have an index.php file and a dashboard.php file outside of that folder.

    If I try to use $_SESSION['test'] = "test" inside the index.php file and output this variable on the dashboard.php file with echo($_SESSION['test']); it works.

    However, if I try to set the test session variable from within processing/login.php, it is not setting the variable anymore! I had the same problem with the cookie variables and I fixed it by passing a "/" argument to the function setcookie()... However, I dont know how to do something similar for the session variable...

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,222
    If that's the issue, you might be able to do the same thing with session_set_cookie_params() (I typed that from memory, so it might not be quite right ).
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles