Skip to content
WJunction - Webmaster Forum

[help] Detect session on URL

Status
Not open for further replies.

jomasaco

Established Member
192
2008
21
[help] ID sessions in url, you now some?

Need to do an function to detect and clean sessions from urls.
Beter way i guess are by regex

Session example:
URL?s= 123gdggdtetft241ytf1ytf4oht5rfde
URL?sid= 123gdggdtetft241ytf1ytf4oht5rfde

?[s|sid]=[0-9a-z] {32}

Please if you know other kind of sessions post them.

any help, suggestion are always welcome.
 
Last edited:

4 comments

Use the preg_match() function with Regex and it'll grab the string and put it into an array for you.

Do not use the eregi set of functions for pattern matching, they're deprecated.
 
yap, are that
preg_replace('/\bs=[0-9a-z]{32}&\b/i' ,"", $url)

but more kind of session's, the aim are clean url's to be unique
 
Do you actually want the session id's appended on the URL?
You can try setting session.use_trans_sid to 0 and session.use_only_cookies to 1 inside your php.ini.

If you don't have access to your php.ini you can try adding it into a .htaccess file like this:
php_value session.use_trans_sid 0
php_value session.use_only_cookies 1

^Adapt this to your hosting environment and see how it works. Also make sure your PHP temp-folder is writable.
 
Jueki isn't that.

each url shold be unique.
wath happen for most ddl's if you pass an url whit session they accept, and you can send same url everyday.

my aim are remove the session from url.
already get the 2 examples above but i guess are more

i chose badly the topic title.
 
Status
Not open for further replies.

About the author

J
Established Member · Joined
192
Messages
21
Reactions
18
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom