session_set_cookie_params and session_save_path

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I seem to be able to get these to work separately, but not together.

So if I do


it saves my sessions to that path.

but if I follow it by
session_set_cookie_params(nnnn, "/blah/blah/")

it breaks session_start.



works fine!!

Is there something I am doing wrong, or is there a workaround?  
Basically, I need a system which allows a browser to sit idle for a  
number of hours for what is an intranet application, but I need my  
sessions stored to a specific location.

Any ideas? Thanks in advance

Re: session_set_cookie_params and session_save_path

Quoted text here. Click to load it

 You've possibly misunderstood the "path" parameter on
session_set_cookie_params - it's the URL path prefix for which the cookie
applies - corresponding to the path parameter on setcookie() - it is not the
session save path.

Andy Hassall :: :: :: disk and FTP usage analysis tool

Re: session_set_cookie_params and session_save_path

turnitup wrote:
Quoted text here. Click to load it

Session data is saved to /blah/blah

Quoted text here. Click to load it

The client sends cookies to pages in " "
but the script where you call session_start() is not in that directory,
so it never receives a session id from the client.

Quoted text here. Click to load it

Unless you changed `session.cookie_path` in php.ini, this is the
same as

  session_set_cookie_params(nnnn, '/');

Quoted text here. Click to load it

The client and the server are in synch! :)

Quoted text here. Click to load it

Do not use session_set_cookie_params(), or, if you must, keep it short
and omit the 'path` parameter.

File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

Re: session_set_cookie_params and session_save_path

Thank you all for your replies. I will see how it goes.

Site Timeline