Development

#2213 (sfWebController's redirect loses session without cookies)

You must first sign up to be able to contribute.

Ticket #2213 (new defect)

Opened 3 years ago

Last modified 2 years ago

sfWebController's redirect loses session without cookies

Reported by: Alex.Walker Assigned to: fabien
Priority: major Milestone:
Component: controller Version: 1.0.5
Keywords: Cc:
Qualification: Patch rejected, quality issue

Description

If cookies are disabled by the client and "session.use_trans_id = 1", then the url generated by this class does not append the session variable before redirecting.

Something like this is needed inside redirect() or genUrl():

if (session_id() !== '' && !$response->hasCookies() )
{
   $url .= '?'.session_name().'='.session_id();
}

Change History

09/15/07 09:05:53 changed by Alex.Walker

  • version set to 1.0.5.

I obviously made this up.

  !$response->hasCookies();

This is what I used, except without the check for session_id() because I will always start the session.

if( session_id() != '' && empty($_COOKIE) )
{
        if( false !== strpos($url, '?') )
	{
		$url .= '&'.session_name().'='.session_id();
	}
	else
        {
		$url .= '?'.session_name().'='.session_id();
        }
}

02/08/08 23:17:13 changed by dwhittle

  • qualification set to Patch rejected, quality issue.

Please provide a valid patch against 1.1.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.