Skip to content

Restarting session after ID regeneration looses session #129

@KacerCZ

Description

@KacerCZ
  • bug report? yes
  • feature request? no
  • version: 2.4.6

Description

I found problem with restarting session after session ID was regenerated.
This is because \Nette\Http\Session::start() takes session ID always from request cookie. Invocation of \Nette\Http\Session::regenerateId() changes session ID. Closing session and starting session again changes session ID to value which is stored in cookie, but this session ID is already deleted.

Steps To Reproduce

$session = new Session(); $session->start(); // Session ID is taken from cookie. $session->regenerateId(); // Session ID is changed. $session->close(); // Session with old ID is deleted, session with new ID is written. $session->start(); // Session ID is taken from cookie - PROBLEM  // it is old session ID, not the regenerated one and all session data are lost

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions