Start PHP-Session when MouseOver

By : Mossawi

    <?php $_SESSION['sessionasdf'] = 'asdf'; ?>


Hello! I have been busy with this for an hour, but I'm deadbrain now. Can someone help me out or give me a hint? Is the function I wrote above, even possible?

Thanks in advance!

By : Mossawi


As I said you have to use a technique called AJAX.. So its time to start learning:)

By : Filkor

PHP run on server, JQuery(the javascript) run on browser.That's different. And you can start the session at every page on server, rather than by the event on browser.

By : joaner

You need an Ajax Request to do this. You can't simply start a session in a script that's already been loaded.

$("#profile_bar").mouseover(function() {
        url: "sessionStartPage.php",
        cache: false,
        success: function(data) {
            alert("session has begun. Refreshing page now");
            location.reload(); //reload the page to load session variables
By : jmishra

This video can help you solving your question :)
By: admin