Professional Web Applications Themes

#25116 [Fbk->Opn]: PHP can't find session, it starts the new session - PHP Development

ID: 25116 User updated by: leo dot jokinen at laurea dot fi Reported By: leo dot jokinen at laurea dot fi -Status: Feedback +Status: Open Bug Type: Session related Operating System: Windows XP home PHP Version: 4.3.2 New Comment: I've tried to use these files to get access to the session. page1.php: <?php session_start(); $_SESSION["test"] = "Hello World"; echo 'The content is '. $HTTP_SESSION_VARS['test']; ?> <br><a href="page2.php">Next Page</a> Page2.php: <?php session_start(); echo 'The content is '. $HTTP_SESSION_VARS['test']; ?> <br><a href="page1.php">Previous Page</a> If things would happening correctly, i would see the Hello World text also page 2. Instead the PHP makes ...

  1. #1

    Default #25116 [Fbk->Opn]: PHP can't find session, it starts the new session

    ID: 25116
    User updated by: leo dot jokinen at laurea dot fi
    Reported By: leo dot jokinen at laurea dot fi
    -Status: Feedback
    +Status: Open
    Bug Type: Session related
    Operating System: Windows XP home
    PHP Version: 4.3.2
    New Comment:

    I've tried to use these files to get access to the session.
    page1.php:
    <?php
    session_start();
    $_SESSION["test"] = "Hello World";
    echo 'The content is '. $HTTP_SESSION_VARS['test'];
    ?>
    <br><a href="page2.php">Next Page</a>

    Page2.php:
    <?php
    session_start();
    echo 'The content is '. $HTTP_SESSION_VARS['test'];
    ?>
    <br><a href="page1.php">Previous Page</a>

    If things would happening correctly, i would see the Hello World text
    also page 2. Instead the PHP makes second session-file, so it can't
    find correct one for my session.save_path directory.


    Previous Comments:
    ------------------------------------------------------------------------

    [2003-08-17 08:01:12] [email]derickphp.net[/email]

    Not enough information was provided for us to be able
    to handle this bug. Please re-read the instructions at
    [url]http://bugs.php.net/how-to-report.php[/url]

    If you can provide more information, feel free to add it
    to this bug and change the status back to "Open".

    Thank you for your interest in PHP.


    ------------------------------------------------------------------------

    [2003-08-17 08:00:13] leo dot jokinen at laurea dot fi

    Description:
    ------------
    My session.save_path contains these sessionfiles. Every time when i
    reload my page, the new file is being made. PHP won't find the current
    session. This problem happens also when is redirect my code into
    another php-file. I am running php with module of apache 1.3.28.
    Some stats:
    session.auto_start Off
    session.bug_compat_42 On
    session.bug_compat_warn On
    session.cache_expire 180
    session.cache_limiter nocache
    session.cookie_domain no value
    session.cookie_lifetime 0
    session.cookie_path /
    session.cookie_secure Off
    session.entropy_file no value
    session.entropy_length 0
    session.gc_divisor 100 1
    session.gc_maxlifetime 900
    session.gc_probability 1
    session.name PHPSESSID
    session.referer_check no value
    session.save_handler files
    session.save_path /Program Files/PHP/sessions/
    session.serialize_handler php
    session.use_cookies On
    session.use_only_cookies On
    session.use_trans_sid Off




    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=25116&edit=1[/url]

    leo dot jokinen at laurea dot fi Guest

  2. #2

    Default #25116 [Fbk->Opn]: PHP can't find session, it starts the new session

    ID: 25116
    User updated by: leo dot jokinen at laurea dot fi
    Reported By: leo dot jokinen at laurea dot fi
    -Status: Feedback
    +Status: Open
    Bug Type: Session related
    Operating System: Windows XP home
    PHP Version: 4.3.3RC5-dev
    New Comment:

    The problem was ZoneAlarm Pro and maybe PHP's cookie settings, cause
    ZoneAlarm regonizes this (PHPSESSID) cookie for type "3rd party
    cookie". Why the cookie isn't type of session cookie like for example
    google-cookie? But thanks to Sniper (again :) for showing the way to
    the "bug"..


    Previous Comments:
    ------------------------------------------------------------------------

    [2003-08-19 02:58:24] [email]sniperphp.net[/email]

    I guess these still apply (check from phpinfo()!):

    session.use_cookies On
    session.use_only_cookies On
    session.use_trans_sid Off

    If so, we're back to the question: Is the cookie set at all? (easy way
    to check: set your browser to ask confirmation when cookie is about to
    be set)




    ------------------------------------------------------------------------

    [2003-08-18 23:56:38] leo dot jokinen at laurea dot fi

    I was bit hasty for previous comment. Now my code works only when i use
    SID in the link. But for security reasons i want to pass the session id
    via cookie. I have this latest stable CVS snapshot. The only thing what
    i've changed is this line in php.ini:
    session.save_path = "F:/Program Files/PHP/sessions/"

    Here are the code what i am using now:
    Page1.php
    <?php
    session_start();
    $_SESSION['sess_var'] = "Hello world!";
    session_write_close();

    echo "The content is ". $_SESSION['sess_var']. "<br />";
    ?>
    <a href="page2.php?<?php echo SID?>">Next page</a>

    Page2.php
    <?php
    session_start();

    echo "The content is ".$_SESSION['sess_var']."<br />";

    unset ($_SESSION['sess_var']);
    session_write_close();
    ?>
    <a href="page1.php?<?php echo SID?>">First Page</a>

    ------------------------------------------------------------------------

    [2003-08-18 14:07:42] leo dot jokinen at laurea dot fi

    Thanks sniper! =) My php.ini was the fault.
    Dunno what happened there but when i used that recommended ini, things
    starting to click.. Now the coding calls, thnx..

    ------------------------------------------------------------------------

    [2003-08-18 10:34:06] [email]sniperphp.net[/email]

    Please try using this CVS snapshot:

    [url]http://snaps.php.net/php4-STABLE-latest.tar.gz[/url]

    For Windows:

    [url]http://snaps.php.net/win32/php4-win32-STABLE-latest.zip[/url]

    Works just fine here.


    ------------------------------------------------------------------------

    [2003-08-18 10:03:09] leo dot jokinen at laurea dot fi

    Now my page1 looks like this:
    <?php
    session_start();
    $_SESSION["test"] = "Hello World";
    echo 'The content is '. $HTTP_SESSION_VARS['test'];
    ?>
    <br><a href="page2.php?<?php echo SID?>">Next Page</a>

    Still doesn't work for me. I've tried a different browser (Mozilla) but
    nothing happened. =(

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/25116[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=25116&edit=1[/url]

    leo dot jokinen at laurea dot fi Guest

Similar Threads

  1. #25116 [Com]: PHP can't find session, it starts the new session
    By DiosV2 at AOL dot com in forum PHP Development
    Replies: 0
    Last Post: August 25th, 10:00 PM
  2. #25116 [Bgs->Opn]: PHP can't find session, it starts the new session
    By leo dot jokinen at laurea dot fi in forum PHP Development
    Replies: 0
    Last Post: August 19th, 04:56 AM
  3. Replies: 1
    Last Post: August 18th, 03:34 PM
  4. #25116 [NEW]: PHP can't find session, it starts the new session
    By leo dot jokinen at laurea dot fi in forum PHP Development
    Replies: 0
    Last Post: August 17th, 12:59 PM
  5. aspx in IFRAME starts multiple session
    By Jakob Ehn in forum ASP.NET General
    Replies: 1
    Last Post: August 8th, 06:39 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139