PHP session collision -


i wondering if has come across problem users open multiple tabs or windows of web application , discover parts of application using other window/tab's data (i'm sure have).

obviously, occurring because tabs/windows sharing same php session id , when call record , store it's id in session, second window's call replaces id of first window , can cause types of headaches.

what solutions have come avoid problem? putting id in hidden field? using session name rewriting @ top of script (which i'd avoid)? i'm curious solutions have come problem. design junk , shouldn't that? how big players out there solve problem?

same question pose here ...

    <?php       session_start();     // code ...      // if user successful login      $_session['user_id'] = $users_id      // redirect user member page     if (isset($_session['user_id']){     header("location:members.php");     }else{     header("location:login.php");     }      ?> members.php <?php  session_start(); if (!isset($_session['user_id']){      header("location:login.php");     }  echo "welcom user : {$_session['user_id']}"; ?> 

if(isset($_session['user_id']) && !empty($_session['user_id'])) {  echo "welcom user : {$_session['user_id']}"; } else {  header("location:login.php"); } 

Comments