Update ProductController.php

Cause a Bug : Procedure to reproduce it:

On a product page :

1 - Log in
2 - get back to product page, with back browser button (2 times)
3 - Refresh page
4 - Log out

and improved assignCategory ...