Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
352 views
in Technique[技术] by (71.8m points)

session - PHP: what is the purpose of session_name

I'm not quite sure what the purpose of session_names is.. Can someone please explain in what circumstances defining a name would be beneficial?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You have two sites on the same domain. (say, a blog and a forum)

They both run different pieces of software.

If they ran on the same session and used the same variables in $_SESSION, (say, user_id), they would conflict.

session_name lets you give each application a different session.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...