Welcome Guest, Not a member yet? Register   Sign In
Session Without Cookies
#1

[eluser]Tickk[/eluser]
Hi,
Any suggestion / example how can I modified CI so CI Session doesnt use cookies anymore ?

I read at Wiki, there's some 3rd class like Native Session or PHPSession but it looks like for CI 1.5

Any working class with CI >1.7 ?

Thank you
Best regards
#2

[eluser]kgill[/eluser]
The only way to really do sessions without cookies is to embed the session ID in the URL or submit the session ID via POST. Submitting via post isn't entirely practical since you're probably going to have links on your webpages and you don't want to submit a form every time you wish to go to a new page so that leaves embedding it in the URL. I'm pretty sure you can figure that part out so lets get to the other issue here, why do you want to get rid of cookies? Unless you're coding for mobile platforms that can't do cookies - make your life easier and use them.
#3

[eluser]Christoffer[/eluser]
You could use native PHP sessions instead of CI-sessions. Don't forget to use <?php session_start(); ?> on every page though.
#4

[eluser]Neophyte[/eluser]
Native PHP sessions also set a session id in a cookie, it's as kgill said.
#5

[eluser]Tickk[/eluser]
The reason is some of my web visitor can't register, login etc access pages that need session.
First I thought the browser. But I tried IE 6,7,8, Firefox, Opera, Chrome at my computer, all runs well.
And I got reported that some client use IE, some of them use Firefox and they cant access it. But the other use the same browser can access.

Than I thought it would be the session. The session is lost during page transition.
I tried use db for session and still the problem remain.

I tried search here and at Google, I found several developer got same problem, I tried their solution still cant solve the problem.

My last guess is the cookies. So I ask about using session without cookies.

If any of you guys can give me some idea whats wrong with my web, I would really appreciate it.

Thank you.
#6

[eluser]darkhouse[/eluser]
I needed something similar as IE doesn't like any of the session libraries here, including the default CI session library. So one my colleagues wrote this and it works great.

http://codeigniter.com/wiki/Session_Hybrid/

It uses native PHP sessions to manage the session id, ip, user agent and last activity, and then stores all session data in the database. It's a drop in replacement, so no extra work needs to be done to use it.

Hope that helps.
#7

[eluser]Tickk[/eluser]
[quote author="darkhouse" date="1247418055"]I needed something similar as IE doesn't like any of the session libraries here, including the default CI session library. So one my colleagues wrote this and it works great.

http://codeigniter.com/wiki/Session_Hybrid/

It uses native PHP sessions to manage the session id, ip, user agent and last activity, and then stores all session data in the database. It's a drop in replacement, so no extra work needs to be done to use it.

Hope that helps.[/quote]

Thank you DarkHouse.
I already implemented the script.
Now, I'am waiting respoonse from my client. I hope this will solve the problem.
#8

[eluser]Tickk[/eluser]
Hi,
After 2 days using Hybrid Session, I still got the same problem.
But not as much as before. I got 1-3 complains from +/- 300 visitor per day.
Before almost 10 complain every day.

The strange is, some session work for him ( visitor who got problem ), and some session not work.
The session is lost between 2 view from 1 controller.

Any other suggestion to check or modified would be great.
Thank you
#9

[eluser]darkhouse[/eluser]
The next step is to find out everything you can about those users. What platform are they on? What browsers are they using? And most importantly, what are they doing when they lose their session? Maybe it's a problem in your code - the Session Hybrid has solved all of my problems, but I only had issues with IE. If your users are using other browsers, then it's probably an issue with your code. Maybe you're accidentally unsetting something somewhere, or overwriting something. That's about all I can say.




Theme © iAndrew 2016 - Forum software by © MyBB