Skip to content

Tag: session

Trying to use variable in MySQL INNER JOIN

I am a php and MySQL newbie. What I have done is created an html form with a <select> dropdown. Based on the selection from the form, it changes the $_SESSION[campaignID] variable. Changing the selection in the form is supposed to then change what displays on the page. The page consists of a forum style…

How to access php session in javascript file?

Below is my code: index.php file javascript of index.php file HTML of index.php Description: I have a web page with url localhost/index.php. In index.php, I have a submit button on the click of which I call Result javascript method which sets the marks = 55 and put it into the hidden field and takes me to the…

PHP sessions don’t expire. Ever

I’m transferring my application to another server, but I have some issues with the PHP sessions that don’t seem to expire. In php.ini I’ve set: Cookies are enabled, of course. And still, after 5 minutes, if I refresh the page I’m still logged in. Even if I close the browser and reopen …

Warning: session_destroy(): Trying to destroy uninitialized session

my class.inc file: used code for my logout: When the logout function is called, it destroys the session, but shows the warning: I am unable to troubleshoot, as the session is not being destroyed by any other means before the session_destroy() of class.inc. Answer You have to call the function mentioned below …

Detect user exit site

I have an urge to detect when a user leaves my site in order to record accurately the session length of the user in question. I have thought of a couple possible solutions for this: I first thought I could use onbeforeunload and send a simple ajax to record the last activity but what practice has shown me is …