2

If cookies are disabled then session works in following two ways:

  1. Form hidden input tag as session id
  2. session id is appended in url

But will the above two ways works automatically i.e will PHP handle it automatically? or we will have to manually set them? If PHP does it automatically then how ?

Swati
  • 29
  • 10

1 Answers1

1

No, you don't have to set this manually PHP handle this for you
It uses the cookies if available, or else it switch to send it via a url, provided that session.use_trans_sid is enabled

ini_set("session.use_trans_sid", 1);

Notice that URL based session management has additional security risks
and see this link for more infos

user10089632
  • 5,216
  • 1
  • 26
  • 34