Re: Re-initiating an autostarted session

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

 



disguised.jedi@xxxxxxxxx wrote:
Look in the user contributed notes in the session-destroy page.  There
is a function to wipe out the session and has worked nicely for me!
http://www.php.net/session_destroy

Thank you for a message. Anyway, I could not get it working (the code follows) - I do still have exactly the same session id. I'm not sure if you meant that note as you spoke about a function. Anyway, I couldn't find any function that handles the cookies (only one about wiping out a session file from the server but it doesn't do anything for the cookie at the client's side).



	$CookieInfo = session_get_cookie_params();
	if ( (empty($CookieInfo['domain'])) && (empty($CookieInfo['secure'])) ) {
		setcookie(session_name(), '', time()-3600, $CookieInfo['path']);
	} elseif (empty($CookieInfo['secure'])) {
		setcookie(session_name(), '', time()-3600, $CookieInfo['path'], $CookieInfo['domain']);
	} else {
		setcookie(session_name(), '', time()-3600, $CookieInfo['path'], $CookieInfo['domain'], $CookieInfo['secure']);
	}
	unset($_COOKIE[session_name()]);
	session_destroy();

	session_write_close();

	Header("Location: ...");
	exit;


Very mysterous... =/

Ville

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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