Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Regular Coder
    Join Date
    May 2011
    Location
    new york
    Posts
    112
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Login script not functioning properly, does not take $_SESSION variable?

    I have a page that sets $_SESSION['$makemodal'] = 0 and then redirects to a previously visited page (captured through URL parametr) when the user enters the proper criteria.

    However, the $_SESSION['$makemodal'] variable doesn't seem to be changing. It was working, but after a recent security breach, it doesn't seem to working anymore. I looked in the log and I see this... could this be the problem?


    20130326T170036: www.websitename.com/index.php
    PHP Warning: session_start(): open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb25c/b1454/ipg.domainname/websitename/wp-content/themes/Snapwire/header.php on line 2
    PHP Warning: Unknown: open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
    PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session
    20130326T170045: http://www.websitename.com/l/2/micro...fy-2013-u.php/
    PHP Warning: session_start(): open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb25c/b1454/ipg.domainname/websitename/l/2/microsoft-q3-earnings-could-shed-light-on-fy-2013-u.php on line 2
    PHP Warning: session_write_close(): open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb25c/b1454/ipg.domainname/websitename/l/2/microsoft-q3-earnings-could-
    20130326T170046: www.websitename.com/index.php
    PHP Warning: session_start(): open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb25c/b1454/ipg.domainname/websitename/wp-content/themes/Snapwire/header.php on line 2
    PHP Warning: Unknown: open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
    PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session
    20130326T170052: www.websitename.com/index.php
    PHP Warning: session_start(): open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb25c/b1454/ipg.domainname/websitename/wp-content/themes/Snapwire/header.php on line 2
    PHP Warning: Unknown: open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
    PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session
    20130326T170053: www.websitename.com/index.php
    PHP Warning: session_start(): open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb25c/b1454/ipg.domainname/websitename/wp-content/themes/Snapwire/header.php on line 2
    PHP Warning: Unknown: open(/var/php_sessions/sess_79d240df7964302b47efc6305f9e4264, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
    PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session

  • #2
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    you got session_start(); at the top of the page?

    PHP Code:
    <?PHP
    session_start
    ();
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • #3
    Regular Coder
    Join Date
    May 2011
    Location
    new york
    Posts
    112
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arcticwarrio View Post
    you got session_start(); at the top of the page?

    PHP Code:
    <?PHP
    session_start
    ();

    Every page (its the very first statement in the header file, which is on every page)

  • #4
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    it looks like your website doesn't have access to the temp folder in order to use sessions
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • #5
    Regular Coder
    Join Date
    May 2011
    Location
    new york
    Posts
    112
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arcticwarrio View Post
    it looks like your website doesn't have access to the temp folder in order to use sessions

    How do I give it permission?

    I'm using a managed hosting provider

  • #6
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    First step, check that the directory /var/php_sessions/ exists and is writable by your web server.

    What does this report?:
    PHP Code:
    <?php $message = ( file_exists('/var/php_sessions/') ) ? 'found php_sessions directory' 'could not find php_sessions directory'; echo $message?>
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • #7
    Regular Coder
    Join Date
    May 2011
    Location
    new york
    Posts
    112
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arcticwarrio View Post
    First step, check that the directory /var/php_sessions/ exists and is writable by your web server.

    What does this report?:
    PHP Code:
    <?php $message = ( file_exists('/var/php_sessions/') ) ? 'found php_sessions directory' 'could not find php_sessions directory'; echo $message?>

    could not find php_sessions directory

  • #8
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    the easiest fix is a phonecall to your host who should easily be able to fix that for you
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • Users who have thanked Arcticwarrio for this post:

    phpchick (03-27-2013)

  • #9
    Regular Coder
    Join Date
    May 2011
    Location
    new york
    Posts
    112
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arcticwarrio View Post
    the easiest fix is a phonecall to your host who should easily be able to fix that for you


    I called them and they directed me to the ini file and told me to specify a tmp folder on my portion of the server for the path, so I updated it to this

    session.save_path = "/home/users/web/b1454/ipg.domainname/tmp/"


    it is still not working, it is still displaying

    could not find php_sessions directory

  • #10
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,285
    Thanks
    4
    Thanked 201 Times in 198 Posts
    Did you restart Apache after making that change? If not you'll need to so it will see the change.
    Dave .... HostMonster for all of your hosting needs

  • #11
    Regular Coder
    Join Date
    May 2011
    Location
    new york
    Posts
    112
    Thanks
    4
    Thanked 0 Times in 0 Posts
    This fixed it. updating that sessions folder... thanks guys

  • #12
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by phpchick View Post
    I have a page that sets $_SESSION['$makemodal'] = 0 and then redirects to a previously visited page (captured through URL parametr) when the user enters the proper criteria.
    Just thought I would point out, the name of that session key isn't what you think it is. It is quite literally $makemodal and NOT the value of it.

    This is because you've used single quotes and not double quotes. See the link in my signature about quotes to find out more.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


  •  

    Posting Permissions

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