Re: lots of session & POST thingy
| From: | Subhrajyoti Moitra | Date: | Mon, 03 Jul 2000 07:42:42 +0000 |
| Subject: | Re: lots of session & POST thingy | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4456@lists.php.net to get a copy of this message | ||
> yup, each request can generate new session ID
> -- 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 --
>
this thing kind of worked .... but that means i have to send the ID in
each page either in the url or in hidden parameter form ... this is going
to be a pain .. moreover i have to check at the begining of each page that
the user is actually a valid user ... which is messy .... which also
means i have to recode my programs .....
but one more thing regarding this ... doesnt it put a substantial load on
my mysql server... for each page i have to check whether he is a valid
user or not ... persistent connections might help .. but still then if i
about 1000 users logged in ..
what impacts will it have on the sql server....???
secondly once the user logs out "properly" by clicking on the logout
button i delete his entry from the table... but what if he doesnt ... he
just kills the browser ... the session is dead but the the database still
holds the ID and info .... in course of a time.. i need to clean up my
databse ..... this is a bigger pain ....
what does experts suggest i do in this case . please .. i need this badly
..
please ask questions to clarify ....
thanx a lot in advance...