0

I want to create a session-less, cookie-less shopping cart. Where should I start? I am having issues on third-party cookies with Safari (eventually Firefox too) so I cannot use sessions for my cart.

dda
  • 6,030
  • 2
  • 25
  • 34
Dharmendra
  • 216
  • 1
  • 14
  • What is the issue with sessions? – Roman Newaza Jun 11 '13 at 05:57
  • I cannot set cookie on user's computer so session are not persistent i.e, I loose session id. – Dharmendra Jun 11 '13 at 05:58
  • 1
    You mean some users have cookie disabled? The percentage of them is very small. You are still able to propagate session id via url. – Roman Newaza Jun 11 '13 at 06:00
  • Check this -> __A visitor accessing your web site is assigned a unique id, the so-called session id. This is either stored in a cookie on the user side or is propagated in the URL.__ – swapnesh Jun 11 '13 at 06:02
  • and how exactly do you plan to do this?? database write every page? – Kylie Jun 11 '13 at 06:07
  • @KyleK I was thinking of writing a RESTful API to maintain my cart and keep data in db but then also , I will need something to remember my user. – Dharmendra Jun 11 '13 at 06:12
  • yeah, no matter what...you're gonna need at least one cookie.....unless you work some magic with IP address or something – Kylie Jun 11 '13 at 06:14
  • @KyleK I have my cart in iframe so I cannot set cookie on safari. Can we get users mac address in iframe? – Dharmendra Jun 11 '13 at 06:16
  • What you could do is make an ajax shopping cart and assign a variable to Javascript so it is not seen in the url. Which is send in the background with the url. But it is not worth it. 1, just like 0.0001 has no cookies, 0.0001 has no javascript enabled. Second leave the page and come back everything is lost. Also look at http://stackoverflow.com/questions/9930671/safari-3rd-party-cookie-iframe-trick-no-longer-working – MKroeders Jun 11 '13 at 06:17

1 Answers1

0

If you have issues with cookies only you can use session without cookies.

Turn off using cookie with session.use_cookies=0 and session.use_only_cookies=0, and turn on trans sid session.use_trans_sid=1. When use_trans_sid is enabled the session id is attached to the every URL.

But it could that you will need to manually add PHPSESSID to your links.

sectus
  • 15,605
  • 5
  • 55
  • 97