Skip to content
Advertisement

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 post that allows users to

register_shutdown_function doesn’t pass variables…?

I’ve run into some difficulties with register_shutdown_function() in PHP. I have a header.php file which contains: $_SESSION contains an array called “user”, containing things like the user ID and their username. I extract $_SESSION simply so I can use $user[“id”] rather than $_SESSION[“user”][“id”]. Then, in footer.php I have this code: to put the info back into the session, in case

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 results.php page. In

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 the page. Edit: actually, it seems that closing

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 at the top your logout function in the

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 that

Advertisement