Re: lots of session & POST thingy

From: Date: Mon, 03 Jul 2000 05:57:04 +0000
Subject: Re: lots of session & POST thingy
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4437@lists.php.net to get a copy of this message
At 10:18 03/07/00 +0530, you wrote:
hi list, is it that for each "POST" a new session id is created?
yup, each request can generate new session ID
for example have a look at the code below and its corresponding O/P. (i have cookies disabled). //===========a.php============ <? session_start(); echo SID."<br>"; ?> <form action="b.php" method=POST> <input type="submit" value="Sumbit"> </form> //============end of a.php=========== //========b.php============== <? session_start(); echo SID."<br>"; ?> //===========end of b.php====
mmm try this code, i not testing it yet, i dunno your session_start function but i guess it woerk -- form.php3 ---- <form action="b.php" method=POST> <input type="submit" value="Sumbit"> </form> --- end form.php --- after or before generate any Session ID, try run b.php first. --- b.php --- <? if($REQUEST_METHOD == "POST") {
        session_start();
        echo SID."<br>";
                // then up your to put it on cookies or your sql database
                //ie . we use cookies
                $sess = SID.;
                SetCookie("ID",SID.);
        }
else {
        if (empty($ID){
        echo "you got no session ID, please go to form.php3"
} ?> -- end b.php -- -- Doubt whom you will, but never yourself. http://php.klik.or.id

« previous php.general (#4437) next »