clarkwinkelmann BilgehanArslan how are you accessing the Flarum session? Flarum exposes information in the frontend when you are inside of the Single Page App, but that's probably not your situation here. Are you loading information from the Flarum REST API? Or tapping into the Symfony session files?
BilgehanArslan clarkwinkelmann i will add a button with using custom footer and put inside the link username. like x.php?u=username
clarkwinkelmann BilgehanArslan while in Flarum you can access app.session.user.username(). app.session.user is null when logged out, so you'll need to check for that before accessing .username() on it.
BilgehanArslan i add like this for the try <script type='text/javascript'> console.log(app.session.user.username()) </script> i get this error Uncaught TypeError: app.session is undefined
askvortsov Ensure that your JS is running after the SPA has booted: best way to do this is using an initializer (https://docs.flarum.org/extend/frontend.html#transpilation-and-file-structure)
BilgehanArslan i found it myself, document.getElementsByClassName("username")[0].innerText works, thanks