Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how oscommerce manages the session


vikal

Recommended Posts

hi

 

can anyone tell me about how oscommerce manages the works of session..

 

advise me the related files to go depth into it..or any related documentation and forum topic

 

so that it's easy for me to catch the things..

 

since i am adding lots of files while customizing oscommerce...

 

but while run link shows like this

 

http://localhost/ocom/create_account_pay.php

 

instead of like this

 

http://localhost/ocom/index.php?cPath=22&a...dd213a6ac4e1926

 

i wanna to manage things like this

 

 

with best regards

 

vikal

Link to comment
Share on other sites

The session ID is added automatically as long as you use the tep_href_link function so there's no reason to worry about that code in the majority of cases.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

ok thanks

 

now teach me..

 

i have this page..accounttype.php

 

and there are links like

 

<a class="button" href="create_account_pay.php">Sign up</a>

 

now tell me the way so that...

 

it would display in the address bar of browser

 

http://localhost/ocom/create_account_pay.p...f79ed6a1395827..

 

 

with best regards

 

vikal

 

 

 

 

 

 

 

 

 

The session ID is added automatically as long as you use the tep_href_link function so there's no reason to worry about that code in the majority of cases.

 

Jack

Link to comment
Share on other sites

Examples of how to use the code exists throughout the shop but here is the code for your link. If the link is to a non-secure page, change the SSL to NONSSL

   <?php echo '<a class="button" href="' . tep_href_link('create_account_pay.php', '', 'SSL') . '">Sign up</a>';  ?>

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

To not have oscid in url.

You need to force cookies to true and follow it with proper valuews for cookies and cookie path in configure.php file.

 

 

Sessions are maintained either in mysql or a folder(mysql recommended).

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

I mean to say with force cookies set to true You are sure that oscid will not be in the link.

 

If there is some setting fault that will either get cookie usage page or a proper oscommerce page with no oscid concatenated but stored in cookies.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

hi

 

good afternoon

 

well really thanks for help..it really works

but now i got another problem...

now the page with in the oscommerse site...

 

from

create_account_business.php

to

create_business_account_success.php

 

the session works

 

but what to do..when we need to pass the session and cookies to the another...site

 

for example

 

there is a link

 

echo "<br>"."<b>"."Now Click here to pay :"."<br />".'<a href="http://www.paypal.com" >Paypal</a>'."<br />".'<a href="http://www.creditcards.com" >Creditcard</a>'; in

 

create_business_account_success.php and by clicking we need to go to the curresponding site

to pay...and either paypal or creditcard both of them need to store that session id

 

since we have to validate that user accoding to the above scenario

 

help me how to pass the session in this line..to the another site

 

echo "<br>"."<b>"."Now Click here to pay :"."<br />".'<a href="http://www.paypal.com" >Paypal</a>'."<br />".'<a href="http://www.creditcards.com" >Creditcard</a>'; in

 

hoping for solution

 

 

with best regards here

 

 

vikaL

Link to comment
Share on other sites

but what to do..when we need to pass the session and cookies to the another...site

 

session and cookie information cannot simply be passed to another site. they are local to your server. and cookie data is stored on your local machine and only uploaded to the same domain name that created the original cookie. even another server at your same hosting company cannot get the session or cookie information without jumping through a bunch of hoops. it can be done, but both sites need to agree on a mechanism for doing it.

 

you can pass certain information to paypal, including data held in session variables like the customer name, address, and products in the cart, through the paypal api. you can find documentation to that api on the paypal site. the api uses <form> tags and hidden text fields. however, all of the paypal payment modules for osc handle the data transfer for you, so you shouldn't need to worry about it. even if you passed your osc session data to the paypal site, it wouldn't know what to do with it. paypal doesn't use php.

 

i'm curious as to why you think you need to pass the session information to paypal. especially since the payment modules are doing this already. what is the problem you are trying to solve? you don't need to write a paypal payment module, since it's already been done.

Link to comment
Share on other sites

well

 

really thanks for such nice explanation...but it is not the case related to payment module...

 

ok let me explain it shortly...

 

i have different types of registered user...all of them need to pay to create account on my site...so the file create_business_account.php holds the

related data of paypal or creditcards and other information from corresponding user...so without required payment their account can't be validated..their account_status and account is approved only after the payment...otherwise not

so it's all related to registered user..and for the validation i thought session is needed...but i was wrong according to you

 

so now suggest me...

 

in the above link how to pass those minimum information with the links so that it would be helpful for the validation of that user..

 

you can take the above link to use and teach me...how to do it..

 

 

hoping for solution

 

 

 

 

session and cookie information cannot simply be passed to another site. they are local to your server. and cookie data is stored on your local machine and only uploaded to the same domain name that created the original cookie. even another server at your same hosting company cannot get the session or cookie information without jumping through a bunch of hoops. it can be done, but both sites need to agree on a mechanism for doing it.

 

you can pass certain information to paypal, including data held in session variables like the customer name, address, and products in the cart, through the paypal api. you can find documentation to that api on the paypal site. the api uses <form> tags and hidden text fields. however, all of the paypal payment modules for osc handle the data transfer for you, so you shouldn't need to worry about it. even if you passed your osc session data to the paypal site, it wouldn't know what to do with it. paypal doesn't use php.

 

i'm curious as to why you think you need to pass the session information to paypal. especially since the payment modules are doing this already. what is the problem you are trying to solve? you don't need to write a paypal payment module, since it's already been done.

Link to comment
Share on other sites

really thanks for such nice explanation...but it is not the case related to payment module...

 

ok let me explain it shortly...

 

i have different types of registered user...all of them need to pay to create account on my site...so the file create_business_account.php holds the

related data of paypal or creditcards and other information from corresponding user...so without required payment their account can't be validated..their account_status and account is approved only after the payment...otherwise not

so it's all related to registered user..and for the validation i thought session is needed...but i was wrong according to you

 

so now suggest me...

 

in the above link how to pass those minimum information with the links so that it would be helpful for the validation of that user..

 

you can take the above link to use and teach me...how to do it..

 

hoping for solution

 

hi vikal,

 

your explanation helps. unfortunately, it sounds like a lot of details. i don't mind helping with small fixes, but this sounds like it will end up being more involved and i don't feel very comfortable helping you without fully understanding all of what you're doing. and you're asking for some rather involved changes that osc isn't currently able to handle well.

 

i would suggest looking at your paypal module and reading the paypal api specification (again, this is available from paypal's site) you need to understand how paypal works and see how that api operates. you can probably model your code from the paypal module, once you understand how it works.

 

you do need sessions, to allow someone to log in to your site. but (from what i can tell from your explanation) you need to use the paypal api to have the customer purchase access. as i've said, that does not require passing your session information to paypal, but rather using the paypal api in order to make that transaction happen -- and then you can 'activate' the account for normal access to your store. (this will require further changes, which you will need to figure out.)

 

so start with learning the paypal api and the code.

 

sorry i can't be more helpful at this point. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...