views:

307

answers:

1

I have a strange problem with Zend Session.

I've build a website base in zend frame work and I use Zend_session to store the infos of a log-in user. It's work fine but when I use uploadify to let user upload file to server, i think the uploadify create new session in server and I cannot access the old session i store by Zend_session_namespace before. But at my local server, it stil work perfectly.

When I examine what different between my local and server, I see the session file in my local server have a fixed name, but the session file store in my server always change its name everytime I call new Zend_Session_namespace.

Below is the php.ini setting at my server

session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /var/lib/php/session /var/lib/php/session
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0

Below is from my local server

session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 4 4
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path C:\xampp\tmp C:\xampp\tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0

how can i fixed this problem or setting the server have fixed session filename? Thanks you all,

A: 

I think I found the problem, its because I using the Iframe, and the src in iframe get contents from another Zend controller.

When this controller be called , it 'll generate a new sessionId and set new PHPSESSID,but the main page still use the old PHPSESSID.

I fixed it by load src from a static php file in public folder, and its work fine.

Rhapsody48