dcsimg
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
    21,301
    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 ).
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

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