I'm trying to create an interactive web shell that will let you connect and perform actions in a different website using post requests but I also want the shell to update live (this is the "interactive" part).
I came across Keeping session alive with Curl and PHP and W3School PHP & AJAX but can I blend them together? is it possible to maintain a session with ajax? if not, what should I use to do this project?
EDIT:
To make things more clear, What I'm trying to do is:
- Go to my website
- Put my credentials to google and click a button
- background php sends a post request to google's login page with my credentials
- I see in my website a Login succeeded alert using ajax
- click a button on my website that will retrieve the content of the first email in my mail dir
- send a get request to gmail with php and return the data with ajax
Will it work? In 6 I need a live session to view the page and I'm creating the session on step 3, How do I keep the session alive?