Jump to content

Recommended Posts

CentOS 5.1

PHP 5.2.5

Apache 2.2.8

Smarty 2.6.19

Xdebug 2.0.2

 

Hi. I'm having a problem with my session data being loaded.  When users login to my site, I load there information into the session variable $_SESSION.  The problem is that while navigating around the site, randomly you will suddenly be logged off.  I've been using Xdebug to try to see what's going on.  I have session_start() at the beginning of every page.  Usually after the session is started, $_SESSION is loaded correctly with the previous session data.  But sometimes after the session is started, $_SESSION is completely empty.  Then if I reload the page or go to another page the data will be properly loaded.  I checked the id that's stored in a cookie and it is always the same.  I have no clue what's causing this problem ???  Any help would be greatly appreciated.  Thanks!

 

Joel

 

[session]

session.save_handler = files

session.save_path = "/var/lib/php/session"

session.use_cookies = 1

session.name = mcd

session.auto_start = 0

session.cookie_lifetime = 0

session.cookie_path = /

session.cookie_domain =

session.cookie_httponly =

session.serialize_handler = php

session.gc_probability = 1

session.gc_divisor    = 1000

session.gc_maxlifetime = 1440

session.bug_compat_42 = 0

session.bug_compat_warn = 1

session.referer_check =

session.entropy_length = 16

session.entropy_file = /dev/urandom

session.cache_limiter = nocache

session.cache_expire = 180

session.use_trans_sid = 0

session.hash_function = 1

session.hash_bits_per_character = 5

Link to comment
https://forums.phpfreaks.com/topic/97741-session-data-not-always-loaded/
Share on other sites

Thanks for the help!  I removed one session setting just before making this post, session.cookie_secure.  It seems my sessions are working correctly now, but I'm not sure why that setting would cause that problem.  Anyway, thanks again!

Never mind.  It still seems to be happening :-\ It seems to be rather random.  I'm not using session_stop anywhere and I only use session_destroy for logging out.  I'm also not changing domains but I am going between http and https.  I'll continue to hunt for bugs in my script but I'm pretty much stumped ???

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.