Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 4 votes

What is the osCsid & why you must not loose it.


204 replies to this topic

#201 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 11 April 2012, 00:07

@opiate

I assume you have checked that your includes/configure.php cookie settings are correct ?

The main issue I note from your site is the lack of any expires header causing 304 'errors' on revisit, I would address that first, take a look at your page speed / yslow scores and address what you can.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#202 al3ks

  • Community Member
  • 108 posts
  • Real Name:Aleksander
  • Gender:Male

Posted 22 May 2012, 19:44

@spooks or someone who could help me with this,

I have a few questions regarding this topic.

If I make a link like this:
<a href="mysite/page.php">Link</a>

And I force cookie use in my admin settings, (like you said) the user can browse fine without loosing the cart or suddenly logging out, my question is will this work in every case. I mean is it possible it will not work if the user changes some setting in their browser relating to cookies?

Also I am using the extra info page manger for 2.3.1 which lets me edit custom pages from admin area but it saves the text information on the database and can translate to HTML. But in there the tep_href_link function doesn't work. Is there a way to make a link in there without loosing the osCsid?


Thanks
Aleksander

#203 germ

  • Community Member
  • 13,582 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 22 May 2012, 23:08

The ideal link code would be:

<a href="<?php echo tep_href_link('page.php'); ?>">Link</a>


The gist of the matter is if you don't use the osC function tep_href_link() you run the risk of losing the session and dumping the cart/logging the customer off.

That being said, it's not always true.

I did some testing a long time ago and linked an osc page to a HTML only file that linked back to the osc page. I could go back and forth without losing the session. This may or may not be true for you, It's always best to use the osc function to construct links.

The contribution you mentioned doesn't work using the tep_href_link function because it would have to eval() the code.

The way to tell if links in the contribution generated files will be OK for you is just put something in the cart and click the link. Then go to the shopping cart page. If the cart is empty you lost the session.

If not - you're good to go.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#204 al3ks

  • Community Member
  • 108 posts
  • Real Name:Aleksander
  • Gender:Male

Posted 22 May 2012, 23:51

View Postgerm, on 22 May 2012, 23:08, said:

The ideal link code would be:

<a href="<?php echo tep_href_link('page.php'); ?>">Link</a>


The gist of the matter is if you don't use the osC function tep_href_link() you run the risk of losing the session and dumping the cart/logging the customer off.

That being said, it's not always true.

I did some testing a long time ago and linked an osc page to a HTML only file that linked back to the osc page. I could go back and forth without losing the session. This may or may not be true for you, It's always best to use the osc function to construct links.

The contribution you mentioned doesn't work using the tep_href_link function because it would have to eval() the code.

The way to tell if links in the contribution generated files will be OK for you is just put something in the cart and click the link. Then go to the shopping cart page. If the cart is empty you lost the session.

If not - you're good to go.

Hey thanks for the reply. Any chances to make the contribution show the links using tep_href_link function correctly? how to ecal() the code?

I have tried different things and it works on a simple HTML link when the force cookie use option is true.

#205 germ

  • Community Member
  • 13,582 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 23 May 2012, 00:45

Doing an eval() on the code isn't a good idea.

Forcing cookie use has it's pro's and con's.

If it work for you - run with it.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >