3

If I have an Application that requires the user to log in. If I log in at home on one network then go some where else, like the library down the street and switch networks will the session continue?

In my question this is about Flash SWF embedded in an HTML page requesting a PHP page for login.

Also, it would be helpful to know how this behavior is the same with HTML requests. I mean if Flash uses the browser to send requests then the result is the same for SWFs applications and HTML applications correct?

1.21 gigawatts
  • 16,517
  • 32
  • 123
  • 231
  • 4
    That depends on whether the session is tied to an IP address or if your site just trusts the cookie. Where's the code creating the session? – Wooble Sep 04 '12 at 16:17

2 Answers2

1

Most web requests with Flash are made via the browser and so follow the same rules in terms of what cookies are sent, etc. (the exception is the old file uploader, for which you had to hardcode it into the URL).

If your session are created via the standard PHP session module and you have enabled cookies (i.e. session.use_cookies ini setting), the browser will keep sending the session cookie until you close it.

If you have implemented IP address checks (which you shouldn't, but that's a personal thing), it might be possible for a session to get invalidated based on IP changes which are very likely to happen when you switch networks.

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309
1

I think the question as it's asked is overly simplifying things.

The only sort of "session" that the browser is aware of is the concept of a session cookie. This is a snippet of information stored against a domain which will expire when you close the browser.

PHP sessions are implemented on top of session cookies, so until you close the browser you are in the same session, even if your IP address changes.

I don't know if Flash has its own concept of sessions at all. If not then whether your session expires depends on exactly how the flash application is coded.

I hope this clarifies things.

Community
  • 1
  • 1
Robin Winslow
  • 10,908
  • 8
  • 62
  • 91