Re: Session Issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Gibbs

Tip me if I'm wrong ... is the frustrating part, that the session is
recreated every time you call the server?

If yes, check how the request, you send to your server, looks like.

Sessions in PHP are quite simple, if you once understood how they actually
work. HTTP in general is stateless. So, it doesn't keep any state of your
user. If you now create a session, you basically give the client an ID (the
session ID) that it can be re-identified by.

This session-id usually is sent using a Cookie. Please check if you get the
cookie with the correct value in your client (probably your web browser)
and check, that the client again sends it to the server on the next
request. If you don't do so, PHP thinks you are a user without a previously
created session.

Bye,
Simon

On Sat, Dec 20, 2014 at 2:16 PM, Gibbs <linux@xxxxxxxxxxxxxxx> wrote:
>
> I am having problems with sessions. We use PHP-FPM on Ubuntu 14.04 and
> every time a request is made PHP will generate a new session file and
> ID. Here is the test code:
>
> session_start();
>
> echo session_id();
>
>
> The session file is created with read/write access to the user the
> process is running as. Its pretty frustrating so if anyone can point me
> in the right direction that would be great.
>
> Here are the settings for the user 'saint'
>
> session.auto_start      Off     Off
> 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    /dev/urandom    /dev/urandom
> session.entropy_length  32      32
> session.gc_divisor      1000    1000
> session.gc_maxlifetime  1440    1440
> session.gc_probability  0       0
> 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-sessions/saint/
> /var/lib/php-sessions/saint/
> session.serialize_handler       php     php
> session.upload_progress.cleanup         On      On
> session.upload_progress.enabled         On      On
> session.upload_progress.freq    1%      1%
> session.upload_progress.min_freq        1       1
> session.upload_progress.name    PHP_SESSION_UPLOAD_PROGRESS
> PHP_SESSION_UPLOAD_PROGRESS
> session.upload_progress.prefix  upload_progress_        upload_progress_
> session.use_cookies     On      On
> session.use_only_cookies        On      On
> session.use_strict_mode         Off     Off
> session.use_trans_sid   0       0
>
>
>
> Cheers,
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux