Si vous avez déjà eu à faire à ce cas de figure, où vous devez définir une variable de session juste avant un appel à la fonction header() pour changer de page (header('Location: ...');), alors vous avez sans doute remarqué qu'une fois arrivé sur la page, vous n'avez plus aucune trace de votre variable de session !
Pour palier à ce petit problème, il suffit de rajouter à votre URL l'id de la session grâce à la constante SID, comme suit :
<?php $_SESSION['foo'] = 'bar'; header('Location: mypage.php'.SID);
Commentaires :
# X4D34th, le jeudi 7 avril 2011 à 17:15:59 # delphiki, le jeudi 7 avril 2011 à 17:51:24Exact, mais le mieux reste quand même de rester indépendant au maximum de la configuration serveur :)
Tiens, deux semaines plutôt ça aurait été génial cette petite astuce. Ici, j'ai du m'en passer en trouvant un système alternatif ;)
Merco ;)
Je t'en prie :)
Désolé d'arriver trop tard ^^
Félicitations et merci pour ton travail
Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it
Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it
very interesting , good job and thanks for sharing such a good blog.
Interesting stuff to read. Keep it up.
this is very informative and intersting for those who are interested in blogging field.
thanks really effective list to boost up ranking in search engine.
very interesting , good job and thanks for sharing such a good blog
this is very informative and interesting for those who are interested in blogging field
I am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job . Keep it up
Another great PHP tutorial from you, thanks a lot!
I am so happy to find this amazing tutorial!
You always gave an amazing update about this topic
Genius man, great tip.
nice
amaging
Jusqu'à ce qu'ils vous laissent et que vous les voulez en arrière
this is awesome! thanks for sharing!
Thanks for sharing this interesting piece
This is a great post as always. Your blog is amazing and a source of inspiration indeed to lots of people who lost theirs
I've been facing this challenge for a while now but didn't know how to go about it. Thanks for sharing this solution
This is a great post as always. Your blog is amazing and a source of inspiration indeed to lots of people who lost theirs
<a href='https://www.newbirthdaywishes.com/happy-birthday-wishes-for-colleagues/'>birthday wishes for team member</a>
<a href='https://www.newbirthdaywishes.com/happy-birthday-wishes-for-colleagues/'>birthday wishes for team member</a>
One essential point to remember (which may or may not apply to your situation) is that if the session is managed via cookies, cookies can be restricted to certain directories and subdirectories inside those directories. In any case, the subdirectory will have access to the session in your situation.
I realize this is an old topic, but I have discovered a solution. After the header, I've included an exit.
I REALLY LIKE YOUR POST, THANKS...
Thank you, I've recently been looking for information about this topic!
Thank you, I've recently been looking for information about this topic!
Great post! really knowledgeable!
Good job! Amazing post!
Thanks for this useful article.... nice creation!
Nice blog. Keep sharing!!!
Good job! Amazing post!
Although it is generally instructive, some of the points do not apply to the majority of circumstances
Pretty interesting but i do have one question.. ? do you have other sites like this?
Nice
Can I post reply back?
I thought this was going to be some boring old post
Thanks for sharing this informative post.
<a href="https://www.winchester-roofing.co.uk/"> roofing repair near me </a>
https://www.seriezloaded.com">best series
Thanks for sharing this informative post.
Thanks for sharing this amazing post. I really appreciate your efforts, good job.
I have bookmarked your blog. Thanks for sharing.
great post
great
thankss
such a great post
Thanks for this informative inputs! Keep it up
great post
great post.
great post.
nice post.
Si on a accès à la config de PHP, on peut aussi faire en sorte qu'il mette le SID en cookie.