To start this topic off:
This works : php and external javascript
This leads me to believe that there is some way to echo javascript in a file named javascript.php within the applications/controllers folder as then to include the js src = base_url().'javascript.php' in a view.
I would like the added security of my codeigniter application in my js. It makes sense to me in cases where I might edit the csrf token output to store in a session var instead of a cookie and pass it to the script.php from a controller initially and then I'd have to use ajax to get new ones ,but, the script could be more secure and I wouldn't need to use cookies. I have not seen anything like it so far in all of my searches , but, that does not always mean that its impossible or impractical.