I have my Codeigniter application running in htdocs ==> htdocs/ciapp And core php application also in htdocs ==> htdocs/coreapp
Both apps are using a single MySQL DB
User lands on ciapp and login there, Afterwards, the user goes to coreapp and also login there.
Authentication is done from the same user table (using the same stored hash), somehow I acheived this functionality.
I want my user to just log in at one place (ciapp). When I access ciapp session in my external coreapp it prints data but I am unable to get userdata from session (e.g. email, username)
session_start();
echo '<pre>';
echo '<br/>------------- session_save_path-------- <br/>';
print_r(session_save_path());
echo '<br/>------------- session_name-------- <br/>';
print_r(session_name());
echo '<br/>------------- $_COOKIE -------- <br/>';
print_r($_COOKIE);
echo '<br/>------------- $_SESSION -------- <br/>';
print_r($_SESSION);
exit;
Seniors, please help me to
- Achieve functionality of giving access to coreapp to already logged in ciapp users
- getting userdata (username, email, id etc. anything) because I have several MySQL DB queries in coreapp and they are using email for conditions.
I have gone through the whole web and found various solutions but nothing worked. Thanking you in anticipation.
source https://stackoverflow.com/questions/69328966/codeignitor-and-core-php
Comments
Post a Comment