Why are AppleID and SessionID the same?
I have 2 iPads using the same AppleID and logging into the same php website on the same cellular network. When one person logs in it works correctly. When a second person logs in, then both iPad reflect the second person that logged in. I have checked and they are sharing one session ID.
I then went on to trouble shoot the problem. This is happening on both wifi and on a cellular with two particular iPads sharing an AppleID. When I had my client add another iOS device (iPhone) into the mix that had a different apple id, it reflected a different session ID.
How can a session ID be shared between machines? Do iOS devices sharing an apple ID also share PHP session ID's?
Here is the login code:
<?php session_start(); if( isset( $_POST['login'])&&!isset($_SESSION['loggedin'])){ $user = $_POST['user']; $number = $_POST['number']; $sql ="SELECT `id`,`user`, `number` FROM `users` WHERE `user` = '$user' AND `number` = '$number'"; $result = mysql_query($sql, $connection)ordie("Something is wrong with your SQL statement."); if(mysql_num_rows($result)==1){ $row = mysql_fetch_assoc($result); if($row){ $_SESSION['loggedin']=1; $_SESSION['loggedinuser']= $row['user']; $_SESSION['number']= $row['number']; } }else{ echo "Wrong Username or Password"; } }
iPad