I had a few ideas on how this would work, but nothing is working so far.
When user logs into php/codeigniter app, email address is stored into session data. onLoad, I want to prepop a field with the email address of the user that logs in using jquery.
I am using this to output the code on the page for testing:
<?php
$userEmail = $this->session->userdata('USER_EMAIL');
echo $userEmail;
?>
Best way to do it, would be to just use php like so:
<input type="text" name="userEmail" value="<?php echo htmlentities($userEmail); ?>" />
But if you want to use jQuery, just do something like this:
$("#userEmailId").val("<?php echo htmlentities($userEmail); ?>");
For clarity sake, session data only exists server-side. If you want to access it client-side(in jquery), it needs to be in the actual page somewhere, or in a cookie.