The Little Guy Posted October 6, 2008 Share Posted October 6, 2008 Using this function: session_set_cookie_params(43200,"/",".dudeel.com",FALSE); Can I set the first param, so that the session ends: "at end of session", instead of a default set time? Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/ Share on other sites More sharing options...
The Little Guy Posted October 6, 2008 Author Share Posted October 6, 2008 anyone? Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658083 Share on other sites More sharing options...
revraz Posted October 6, 2008 Share Posted October 6, 2008 Not really sure what you are asking. If you don't set a Time, then the cookie expires when the browser is closed. Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658088 Share on other sites More sharing options...
The Little Guy Posted October 6, 2008 Author Share Posted October 6, 2008 so, can I set the first value to NULL, so the session expires when the browser closes? Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658093 Share on other sites More sharing options...
R0bb0b Posted October 6, 2008 Share Posted October 6, 2008 I misunderstood the question. Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658097 Share on other sites More sharing options...
R0bb0b Posted October 6, 2008 Share Posted October 6, 2008 I really don't think there is any "reliable" way of determining(on the server side anyway) when the browser closes. Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658101 Share on other sites More sharing options...
The Little Guy Posted October 6, 2008 Author Share Posted October 6, 2008 I really don't think there is any "reliable" way of determining(on the server side anyway) when the browser closes. Not what I mean. When a session starts, you can set custom cookie params, using the above function. You need to set when the function expires (first parameter), I want to know if there is a way to set the cookie to expire when the browser closes. Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658106 Share on other sites More sharing options...
The Little Guy Posted October 6, 2008 Author Share Posted October 6, 2008 OK, I got it! session_set_cookie_params(NULL,"/",".dudeel.com",FALSE); Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658107 Share on other sites More sharing options...
R0bb0b Posted October 6, 2008 Share Posted October 6, 2008 But this does not mean that the session expires when the browser is closed, the session could have expired long before that. Your just talking about the cookie right? What I am saying is that you can extend the session server side to be longer than default and modify the cookie separately to expire when the browser is closed(I'm pretty sure). Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658115 Share on other sites More sharing options...
thebadbad Posted October 6, 2008 Share Posted October 6, 2008 OK, I got it! session_set_cookie_params(NULL,"/",".dudeel.com",FALSE); I believe it works, but the parameter should be an integer. 0 means "until the browser is closed", per the manual. Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658117 Share on other sites More sharing options...
The Little Guy Posted October 6, 2008 Author Share Posted October 6, 2008 http://php.net/session_set_cookie_params 0 is not "until the browser is closed" - I even tried, it and it didn't work, setting it to NULL did. Link to comment https://forums.phpfreaks.com/topic/127192-solved-cookie-params/#findComment-658121 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.