Take the 2-minute tour ×

For one of my project's (weird) requirements, I want to use cookie less sessions. At the same time, "session.use_trans_sid" can not be turned on :(

Does anybody please let me know if is there any other way out ??

Thanks Manish

share|improve this question
Why can’t you turn session.use_trans_sid on? –  Gumbo May 4 '11 at 11:17
Dumb answer is "That is the requirement" .. But I guesss it is for avoiding the SESSIONID getting displayed in the URL –  Manish May 4 '11 at 11:25
Then there is no way to do it. The session ID needs to be transferred somehow. Either per cookie or per URL. –  Gumbo May 4 '11 at 11:29
add comment

3 Answers

Make a custom session manager (see this tutorial, for example) that identifies the user based on, for example, IP address and user agent and other identifying factors (as IP+UA might not and probably will not be unique). Another (ugly) solution is to just implement the use_trans_sid functionality yourself by adding a session identifier GET parameter to every link by hand (if it's a small site) or with a hidden form (that's non-standard).

share|improve this answer
The combination if IP address and user agent identifier is not unique! –  Gumbo May 4 '11 at 11:16
No, it necessarily isn't - but it was simply an example. –  Shadikka May 4 '11 at 11:17
And a very inadvisable example. –  Gumbo May 4 '11 at 11:18
Edited the answer to reflect that it was definitely not meant to be a complete solution. –  Shadikka May 4 '11 at 11:20
add comment

If you really want sessions without cookies, you can always put the SID in all your URLs manually. People used to do this quite a bit. :-)

share|improve this answer
add comment

The only other option is to keep the session data on the client and pass it back and forth to and from the server with each request, although technically that would be a sessionless architecture.
That means that for GETs each link has to be rewritten to include all the session variables, and for POSTs they have to be included as hidden fields.

share|improve this answer
add comment

Your Answer


