Jump to content

xampp php session files and firefox browser


Recommended Posts

Hi everyone,

I am having a problem with a xampp php installation regarding session file generation using firefox browser. 

problem: i create a session variable which acts as a token on the server side. The token is used to display an image, then the token (session array key) is deleted. Thus, i am able to prevent access to protected images. Everything is working, in Edge and Chrome. Whenever i use firefox browser to test the site on xampp, i notice a session file creation in the tmp file. I go to Tools > Page Info > Media tab. My images do not appear in the media tab (which is good because they are protected.) However, every time that i click on one of the media links in the tab, a new session file is created in the tmp directory of my xampp installation (size 0bytes). It seems like PHP or xampp is not managing sessions correctly. A new session is started for each image requested from the firefox pageinfo media tab. Should i report this to xampp or is there another reason why this is happening? should i manually set session handlers? has anyone else noticed this problem?

Thank you,

John

Link to comment
Share on other sites

Hi everyone,

bananaman: you really do not know how to set a session variable and unset it? you need to see that code? O.O 

good thing that i have solved the problem. session_start either continues a session or starts a new one. I learned PHP at home and using forums for help when needed. I was always told to use session_start() on every page that uses 'the' session. It seems as though this is not correct or a certain usage exists that is not described in the PHP manual. I decided to name my session cookies in the php.ini file, then add an if statement in the getImage.php file. so if mycookie isset then session_start(), else show image error.

Meantime, i maintain multiple versions of browsers for html and css testing. The start a new session only happens in older versions of firefox (50, 51, 60). The curent 108 does not make a new session file.

Anyway, my understanding of sessions is the problem here and that is a big problem since the official manual does not address proper session handling and usage in depth. I have to learn how to handle sessions properly before continuing to develop websites.

Thank you for taking time to read this post. I hope that everyone has a lovely New Year's eve. Please be safe and do not drink alcohol and drive. I hate alcohol so it is not a problem for me but i am concerned about all of you.

John

Link to comment
Share on other sites

6 hours ago, jodunno said:

Anyway, my understanding of sessions is the problem here and that is a big problem since the official manual does not address proper session handling and usage in depth

Generally speaking, a person does not want to conditionally start a session.  Either you're using the session data in your (so you start it), or you're not (so you don't).  In addition, people don't generally care about empty session files (they get generated all the time usually).  You're essentially trying to solve a problem that most people simply don't see a problem at all.  Those empty files don't hurt anything and will get cleaned up eventually.

 

On a side note, while what you are describing might make it slightly more difficult for your average person to download your images, it by no means prevents it.  If the browser can display it, the user can save it, simple as that.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.